Skip to content

Instantly share code, notes, and snippets.

@aaron-prindle
Last active June 26, 2025 20:42
Show Gist options
  • Save aaron-prindle/d831cfa6dce6a7d072f7449d76f433e9 to your computer and use it in GitHub Desktop.
Save aaron-prindle/d831cfa6dce6a7d072f7449d76f433e9 to your computer and use it in GitHub Desktop.

Revisions

  1. aaron-prindle revised this gist Jun 26, 2025. 1 changed file with 0 additions and 5 deletions.
    5 changes: 0 additions & 5 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -3,11 +3,6 @@ if len(parts) < 2 {
    t.Errorf("ReplicaSet name should contain at least one hyphen separator")
    }

    hash := parts[len(parts)-1]
    if len(hash) != 10 {
    t.Errorf("Expected hash length of 10, got %d", len(hash))
    }

    deploymentPortion := strings.Join(parts[:len(parts)-1], "-")
    if len(test.deploymentName) <= 242 {
    if deploymentPortion != test.deploymentName {
  2. aaron-prindle created this gist Jun 26, 2025.
    20 changes: 20 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    parts := strings.Split(rsName, "-")
    if len(parts) < 2 {
    t.Errorf("ReplicaSet name should contain at least one hyphen separator")
    }

    hash := parts[len(parts)-1]
    if len(hash) != 10 {
    t.Errorf("Expected hash length of 10, got %d", len(hash))
    }

    deploymentPortion := strings.Join(parts[:len(parts)-1], "-")
    if len(test.deploymentName) <= 242 {
    if deploymentPortion != test.deploymentName {
    t.Errorf("Deployment name portion mismatch: got %q, want %q", deploymentPortion, test.deploymentName)
    }
    } else {
    if len(deploymentPortion) != 242 {
    t.Errorf("Truncated deployment name should be 242 chars, got %d", len(deploymentPortion))
    }
    }