kubernetes/kops · error

tag split failed, too few components for tag %q

Error message

tag split failed, too few components for tag %q

What it means

Format-validation guard in getDropletInstanceGroup: a droplet tag containing the k8s-instancegroup marker was found, but splitting on ':' yielded fewer than two parts, so the instance group name component is missing. Indicates a malformed/foreign tag on the droplet.

Source

Thrown at upup/pkg/fi/cloudup/do/cloud.go:477

			InstanceGroupName: instanceGroupName,
			GroupType:         instanceGroupName,
			ClusterName:       clusterName,
			Members:           instanceGroupMap[instanceGroupName],
		})
	}

	klog.V(8).Infof("InstanceGroup Info = %v", result)

	return result, nil
}

func getDropletInstanceGroup(tags []string) (string, error) {
	for _, tag := range tags {
		klog.V(8).Infof("Check tag = %s", tag)
		if strings.Contains(strings.ToLower(tag), TagKubernetesInstanceGroup) {
			tagParts := strings.Split(tag, ":")
			if len(tagParts) < 2 {
				return "", fmt.Errorf("tag split failed, too few components for tag %q", tag)
			}
			return tagParts[1], nil
		}
	}

	return "", fmt.Errorf("Didn't find k8s-instancegroup for tag %v", tags)
}

// matchInstanceGroup filters a list of instancegroups for recognized cloud groups
func matchInstanceGroup(name string, clusterName string, instancegroups []*kops.InstanceGroup) (*kops.InstanceGroup, error) {
	var instancegroup *kops.InstanceGroup
	for _, g := range instancegroups {
		var groupName string

		switch {
		case g.Spec.Role.HasControlPlane(),
			g.Spec.Role.HasNode():
			groupName = clusterName + "-" + g.ObjectMeta.Name

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Fix the droplet tag to the form k8s-instancegroup:<name>
  2. Remove stray tags that merely contain the marker substring
  3. Re-run the operation
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at upup/pkg/fi/cloudup/do/cloud.go:477 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/d04556ba153c247b. Report an issue: GitHub.