GoogleContainerTools/skaffold · error

could not fetch config connector resources: %w

Error message

could not fetch config connector resources: %w

What it means

getConfigConnectorResources wraps any error from selecting Config Connector resources out of the rendered manifest list with this message. This is a manifest-selection error, not a cluster API error — the failure happens in SelectResources before any client call.

Source

Thrown at pkg/skaffold/kubernetes/status/status_check.go:308

	if err != nil {
		return nil, fmt.Errorf("could not fetch standalone pods: %w", err)
	}
	if len(pods) == 0 {
		return result, nil
	}
	pd := diag.New([]string{ns}).
		WithLabel(label.RunIDLabel, l.Labels()[label.RunIDLabel]).
		WithValidators([]validator.Validator{validator.NewPodValidator(client, selector)})
	result = append(result, resource.NewResource(string(resource.ResourceTypes.StandalonePods), resource.ResourceTypes.StandalonePods, ns, deadlineDuration, tolerateFailures).WithValidator(pd))

	return result, nil
}

func getConfigConnectorResources(client kubernetes.Interface, dynClient dynamic.Interface, m manifest.ManifestList, ns string, l *label.DefaultLabeller, deadlineDuration time.Duration, tolerateFailures bool) ([]*resource.Resource, error) {
	var result []*resource.Resource
	uRes, err := m.SelectResources(manifest.ConfigConnectorResourceSelector...)
	if err != nil {
		return nil, fmt.Errorf("could not fetch config connector resources: %w", err)
	}
	for _, r := range uRes {
		resName := r.GroupVersionKind().String()
		if r.GetName() != "" {
			resName = fmt.Sprintf("%s, Name=%s", resName, r.GetName())
		}
		pd := diag.New([]string{ns}).
			WithLabel(label.RunIDLabel, l.Labels()[label.RunIDLabel]).
			WithValidators([]validator.Validator{validator.NewConfigConnectorValidator(client, dynClient, r.GroupVersionKind())})
		result = append(result, resource.NewResource(resName, resource.ResourceTypes.ConfigConnector, ns, deadlineDuration, tolerateFailures).WithValidator(pd))
	}

	return result, nil
}

func getCustomResources(client kubernetes.Interface, dynClient dynamic.Interface, m manifest.ManifestList, ns string, deadlineDuration time.Duration, tolerateFailures bool, selector manifest.GroupKindSelector) ([]*resource.Resource, error) {
	var result []*resource.Resource
	uRes, err := m.SelectResources(selector)

View on GitHub (pinned to a1189de023)

Solutions

  1. Render and lint manifests: 'skaffold render' then yamllint / 'kubectl apply --dry-run=client -f -'
  2. Fix parse errors in the offending YAML (indentation, duplicate keys, bad types)
  3. Confirm Config Connector resource GVKs match manifest.ConfigConnectorResourceSelector for your CNRM version
  4. Bisect the manifest list to isolate the failing document
  5. Upgrade/downgrade skaffold to align selector GVKs with your manifests

Example fix

// before: duplicate key breaks YAML parsing
//   metadata:
//     name: a
//     name: a2
// after:
//   metadata:
//     name: a
Defensive patterns

Strategy: validation

Validate before calling

const docs = YAML.parseAllDocuments(renderedManifests, { uniqueKeys: true });
for (const d of docs) {
  if (d.errors.length) throw new Error('YAML errors will fail config-connector selection: ' + d.errors);
}

Try / catch

try {
  await statusCheck();
} catch (err) {
  if (err.message.includes('could not fetch config connector resources')) {
    // parse/selection failure in manifests — re-render and lint
  }
  throw err;
}

Prevention

When it happens

Trigger: manifest.ManifestList.SelectResources(manifest.ConfigConnectorResourceSelector...) returns an error: manifests fail to unmarshal/parse, or the GVK-based predicate rejects/mis-parses a resource during filtering.

Common situations: Rendered manifests with duplicate YAML keys or invalid types; CRD-like CNRM resources with unexpected fields; annotation injection duplicating entries; upgrading skaffold while manifests use deprecated fields.

Related errors


AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05). Data as JSON: /api/errors/053799b3a4a7da25. Report an issue: GitHub.