Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for FormatMap (0.11 sec)

  1. pkg/fieldpath/fieldpath.go

    */
    
    package fieldpath
    
    import (
    	"fmt"
    	"sort"
    	"strconv"
    	"strings"
    
    	"k8s.io/apimachinery/pkg/api/meta"
    	"k8s.io/apimachinery/pkg/util/validation"
    )
    
    // FormatMap formats map[string]string to a string.
    func FormatMap(m map[string]string) (fmtStr string) {
    	// output with keys in sorted order to provide stable output
    	keys := make([]string, 0, len(m))
    	var grow int
    	for k, v := range m {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Mar 02 06:26:55 UTC 2023
    - 3.7K bytes
    - Viewed (0)
  2. pkg/fieldpath/fieldpath_test.go

    node.alpha.kubernetes.io/ttl="0"
    volumes.kubernetes.io/controller-managed-attach-detach="true"`,
    		},
    	}
    	for _, tt := range tests {
    		t.Run(tt.name, func(t *testing.T) {
    			if gotFmtStr := FormatMap(tt.args.m); gotFmtStr != tt.wantFmtStr {
    				t.Errorf("FormatMap() = %v, want %v", gotFmtStr, tt.wantFmtStr)
    			}
    		})
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Mar 02 06:26:55 UTC 2023
    - 10.3K bytes
    - Viewed (0)
  3. pkg/bootstrap/config_test.go

    			// Using the function kubernetes actually uses to write this, we do a round trip of
    			// map -> file -> map and ensure the input and output are the same
    			got, err := ParseDownwardAPI(fieldpath.FormatMap(tt.m))
    			if !reflect.DeepEqual(got, tt.m) {
    				t.Fatalf("expected %v, got %v with err: %v", tt.m, got, err)
    			}
    		})
    	}
    }
    
    func TestGetNodeMetaData(t *testing.T) {
    	inputOwner := "test"
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Mar 28 20:38:02 UTC 2024
    - 9.1K bytes
    - Viewed (0)
  4. pkg/volume/downwardapi/downwardapi_test.go

    }
    
    type verifyMapInFile struct {
    	stepName
    	expected map[string]string
    }
    
    func (step verifyMapInFile) run(test *downwardAPITest) {
    	doVerifyLinesInFile(test.t, test.volumePath, step.name, fieldpath.FormatMap(step.expected))
    }
    
    type verifyMode struct {
    	stepName
    	expectedMode int32
    }
    
    func (step verifyMode) run(test *downwardAPITest) {
    	fileInfo, err := os.Stat(filepath.Join(test.volumePath, step.name))
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jun 02 04:48:49 UTC 2023
    - 11.2K bytes
    - Viewed (0)
  5. CHANGELOG/CHANGELOG-1.27.md

    - Fixed incorrect log information in the `iptables` utility. ([#110723](https://github.com/kubernetes/kubernetes/pull/110723), [@yangjunmyfm192085](https://github.com/yangjunmyfm192085))
    - Improved FormatMap: Improves performance by about 4x, or nearly 2x in the worst case ([#112661](https://github.com/kubernetes/kubernetes/pull/112661), [@aimuz](https://github.com/aimuz)) [SIG Node]
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jun 11 23:01:06 UTC 2024
    - 455.3K bytes
    - Viewed (0)
Back to top