Documentation ¶
Overview ¶
Package resolver provides the implementation of the TKR resolver.
Example ¶
package main import ( "k8s.io/apimachinery/pkg/labels" "github.com/vmware-tanzu/tanzu-framework/pkg/v2/tkr/resolver" "github.com/vmware-tanzu/tanzu-framework/pkg/v2/tkr/resolver/data" ) func main() { tkrResolver := resolver.New() k8sVersionPrefix := "1.22" tkrSelector, _ := labels.Parse("!deprecated") osImageSelector, _ := labels.Parse("os-name=ubuntu,ami-region=us-west-2") query := data.Query{ ControlPlane: &data.OSImageQuery{ K8sVersionPrefix: k8sVersionPrefix, TKRSelector: tkrSelector, OSImageSelector: osImageSelector, }, MachineDeployments: []*data.OSImageQuery{ { K8sVersionPrefix: k8sVersionPrefix, TKRSelector: tkrSelector, OSImageSelector: osImageSelector, }, }, } result := tkrResolver.Resolve(query) println("KubernetesVersion", result.ControlPlane.K8sVersion) }
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { // Add TanzuKubernetesRelease or OSImage objects to the resolver cache. Add(objects ...interface{}) // Remove TanzuKubernetesRelease or OSImage objects from the resolver cache. Remove(objects ...interface{}) // Get an object by name and obj type. Get(name string, obj interface{}) interface{} }
Cache holds TKRs and OSImages to be used by the Resolver.
type CachingResolver ¶
CachingResolver combines Resolver and Cache (for convenience).
func New ¶
func New() CachingResolver
New returns a newly created instance of the TKR CachingResolver implementation. It is safe for concurrent use.
Click to show internal directories.
Click to hide internal directories.