kubernetes/kops · error
method ConfigBaseFor not supported in server-side client
Error message
method ConfigBaseFor not supported in server-side client
What it means
ConfigBaseFor returns the VFS path of a cluster's configuration base in the classic CLI clientset. In the server-side controller clientset the concept is intentionally unsupported, and the stub returns this error. Callers must not rely on VFS paths when running server-side.
Source
Thrown at cmd/kops-controller/pkg/controllerclientset/clientset.go:102
// CreateCluster creates a cluster
func (c *client) CreateCluster(ctx context.Context, cluster *kops.Cluster) (*kops.Cluster, error) {
return nil, fmt.Errorf("method CreateCluster not supported in server-side client")
}
// UpdateCluster updates a cluster
func (c *client) UpdateCluster(ctx context.Context, cluster *kops.Cluster, status *kops.ClusterStatus) (*kops.Cluster, error) {
return nil, fmt.Errorf("method UpdateCluster not supported in server-side client")
}
// ListClusters returns all clusters
func (c *client) ListClusters(ctx context.Context, options metav1.ListOptions) (*kops.ClusterList, error) {
return nil, fmt.Errorf("method ListClusters not supported in server-side client")
}
// ConfigBaseFor returns the vfs path where we will read configuration information from
func (c *client) ConfigBaseFor(cluster *kops.Cluster) (vfs.Path, error) {
return nil, fmt.Errorf("method ConfigBaseFor not supported in server-side client")
}
// InstanceGroupsFor returns the InstanceGroupInterface bound to the namespace for a particular Cluster
func (c *client) InstanceGroupsFor(cluster *kops.Cluster) kopsinternalversion.InstanceGroupInterface {
clusterName := cluster.Name
if clusterName != c.clusterName {
klog.Fatalf("clientset bound to cluster %q, got cluster %q", c.clusterName, clusterName)
}
return newInstanceGroups(c.vfsContext, cluster, c.clusterBasePath)
}
// AddonsFor returns the client for addon objects for a particular Cluster
func (c *client) AddonsFor(cluster *kops.Cluster) simple.AddonsClient {
clusterName := cluster.Name
if clusterName != c.clusterName {
klog.Fatalf("clientset bound to cluster %q, got cluster %q", c.clusterName, clusterName)
}View on GitHub (pinned to 4c8573c808)
Solutions
- Do not resolve VFS config paths from the server-side client; use the controller's abstractions (InstanceGroupsFor, SSHCredentialStoreFor already handle paths internally)
- If a path is truly needed, construct it from the controller's configured cluster base path rather than the clientset
- Move the path-dependent logic to a CLI/VFS-backed tool
Example fix
// before basePath, err := client.ConfigBaseFor(cluster) // after: use the methods that already encapsulate the path igStore := client.InstanceGroupsFor(cluster) sshStore, err := client.SSHCredentialStoreFor(cluster)
Defensive patterns
Strategy: validation
Validate before calling
var pathGetter interface{ ConfigBaseFor(*kops.Cluster) (vfs.Path, error) } = client
if _, ok := pathGetter.(interface{ ConfigBaseFor(*kops.Cluster) (vfs.Path, error) }); ok {
_, err := pathGetter.ConfigBaseFor(cluster)
_ = err // only VFS-backed clients support this
} Type guard
func hasConfigBase(c interface{}) bool {
_, ok := c.(interface{ ConfigBaseFor(*kops.Cluster) (vfs.Path, error) })
return ok
} Try / catch
basePath, err := client.ConfigBaseFor(cluster)
if err != nil && strings.Contains(err.Error(), "ConfigBaseFor not supported") {
// derive from configured cluster base path instead
basePath = c.clusterBasePath
} Prevention
- Use the higher-level methods (InstanceGroupsFor, SSHCredentialStoreFor) that encapsulate paths
- Avoid direct VFS path computation when running server-side
- Keep path-dependent logic in CLI tools
When it happens
Trigger: Calling client.ConfigBaseFor(cluster) from controller code, e.g. to compute a state-store path for reading or writing cluster config directly.
Common situations: Code shared with CLI utilities that need the config base path (sshcredentialstore, nodeup bootstrap) being invoked in the controller process.
Related errors
- unexpected kind for cluster, got %T, want kops.Cluster
- method CreateCluster not supported in server-side client
- method UpdateCluster not supported in server-side client
- method ListClusters not supported in server-side client
- method DeleteCluster not supported in server-side client
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/0e84278a5c954f65.
Report an issue: GitHub.