mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 23:37:01 +00:00
Typos and englishify federation
This commit is contained in:
parent
aff7dfcaab
commit
6aaad93908
@ -42,12 +42,12 @@ var Unversioned = unversioned.GroupVersion{Group: "", Version: "v1"}
|
||||
// ParameterCodec handles versioning of objects that are converted to query parameters.
|
||||
var ParameterCodec = runtime.NewParameterCodec(Scheme)
|
||||
|
||||
// Kind takes an unqualified kind and returns back a Group qualified GroupKind
|
||||
// Kind takes an unqualified kind and returns a Group qualified GroupKind
|
||||
func Kind(kind string) unversioned.GroupKind {
|
||||
return SchemeGroupVersion.WithKind(kind).GroupKind()
|
||||
}
|
||||
|
||||
// Resource takes an unqualified resource and returns back a Group qualified GroupResource
|
||||
// Resource takes an unqualified resource and returns a Group qualified GroupResource
|
||||
func Resource(resource string) unversioned.GroupResource {
|
||||
return SchemeGroupVersion.WithResource(resource).GroupResource()
|
||||
}
|
||||
|
@ -28,12 +28,12 @@ const GroupName = "federation"
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal}
|
||||
|
||||
// Kind takes an unqualified kind and returns back a Group qualified GroupKind
|
||||
// Kind takes an unqualified kind and returns a Group qualified GroupKind
|
||||
func Kind(kind string) unversioned.GroupKind {
|
||||
return SchemeGroupVersion.WithKind(kind).GroupKind()
|
||||
}
|
||||
|
||||
// Resource takes an unqualified resource and returns back a Group qualified GroupResource
|
||||
// Resource takes an unqualified resource and returns a Group qualified GroupResource
|
||||
func Resource(resource string) unversioned.GroupResource {
|
||||
return SchemeGroupVersion.WithResource(resource).GroupResource()
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ type ClusterCondition struct {
|
||||
type ClusterStatus struct {
|
||||
// Conditions is an array of current cluster conditions.
|
||||
Conditions []ClusterCondition `json:"conditions,omitempty"`
|
||||
// Zones is the list of avaliability zones in which the nodes of the cluster exist, e.g. 'us-east1-a'.
|
||||
// Zones is the list of availability zones in which the nodes of the cluster exist, e.g. 'us-east1-a'.
|
||||
// These will always be in the same region.
|
||||
Zones []string `json:"zones,omitempty"`
|
||||
// Region is the name of the region in which all of the nodes in the cluster exist. e.g. 'us-east1'.
|
||||
@ -109,7 +109,7 @@ type ClusterList struct {
|
||||
Items []Cluster `json:"items"`
|
||||
}
|
||||
|
||||
// Temporary/alpha stuctures to support custom replica assignments within FederatedReplicaSet.
|
||||
// Temporary/alpha structures to support custom replica assignments within FederatedReplicaSet.
|
||||
|
||||
// A set of preferences that can be added to federated version of ReplicaSet as a json-serialized annotation.
|
||||
// The preferences allow the user to express in which culsters he wants to put his replicas within the
|
||||
|
@ -95,7 +95,7 @@ message ClusterStatus {
|
||||
// Conditions is an array of current cluster conditions.
|
||||
repeated ClusterCondition conditions = 1;
|
||||
|
||||
// Zones is the list of avaliability zones in which the nodes of the cluster exist, e.g. 'us-east1-a'.
|
||||
// Zones is the list of availability zones in which the nodes of the cluster exist, e.g. 'us-east1-a'.
|
||||
// These will always be in the same region.
|
||||
repeated string zones = 5;
|
||||
|
||||
|
@ -75,7 +75,7 @@ type ClusterCondition struct {
|
||||
type ClusterStatus struct {
|
||||
// Conditions is an array of current cluster conditions.
|
||||
Conditions []ClusterCondition `json:"conditions,omitempty" protobuf:"bytes,1,rep,name=conditions"`
|
||||
// Zones is the list of avaliability zones in which the nodes of the cluster exist, e.g. 'us-east1-a'.
|
||||
// Zones is the list of availability zones in which the nodes of the cluster exist, e.g. 'us-east1-a'.
|
||||
// These will always be in the same region.
|
||||
Zones []string `json:"zones,omitempty" protobuf:"bytes,5,rep,name=zones"`
|
||||
// Region is the name of the region in which all of the nodes in the cluster exist. e.g. 'us-east1'.
|
||||
|
@ -75,7 +75,7 @@ func (ClusterSpec) SwaggerDoc() map[string]string {
|
||||
var map_ClusterStatus = map[string]string{
|
||||
"": "ClusterStatus is information about the current status of a cluster updated by cluster controller peridocally.",
|
||||
"conditions": "Conditions is an array of current cluster conditions.",
|
||||
"zones": "Zones is the list of avaliability zones in which the nodes of the cluster exist, e.g. 'us-east1-a'. These will always be in the same region.",
|
||||
"zones": "Zones is the list of availability zones in which the nodes of the cluster exist, e.g. 'us-east1-a'. These will always be in the same region.",
|
||||
"region": "Region is the name of the region in which all of the nodes in the cluster exist. e.g. 'us-east1'.",
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ type Route53API interface {
|
||||
|
||||
// Route53APIStub is a minimal implementation of Route53API, used primarily for unit testing.
|
||||
// See http://http://docs.aws.amazon.com/sdk-for-go/api/service/route53.html for descriptions
|
||||
// of all of it's methods.
|
||||
// of all of its methods.
|
||||
type Route53APIStub struct {
|
||||
zones map[string]*route53.HostedZone
|
||||
recordSets map[string]map[string][]*route53.ResourceRecordSet
|
||||
@ -86,7 +86,7 @@ func (r *Route53APIStub) ChangeResourceRecordSets(input *route53.ChangeResourceR
|
||||
recordSets[key] = append(recordSets[key], change.ResourceRecordSet)
|
||||
case route53.ChangeActionDelete:
|
||||
if _, found := recordSets[key]; !found {
|
||||
return nil, fmt.Errorf("Attempt to delete non-existant rrset %s", key) // TODO: Check other fields too
|
||||
return nil, fmt.Errorf("Attempt to delete non-existent rrset %s", key) // TODO: Check other fields too
|
||||
}
|
||||
delete(recordSets, key)
|
||||
case route53.ChangeActionUpsert:
|
||||
@ -94,7 +94,7 @@ func (r *Route53APIStub) ChangeResourceRecordSets(input *route53.ChangeResourceR
|
||||
}
|
||||
}
|
||||
r.recordSets[*input.HostedZoneId] = recordSets
|
||||
return output, nil // TODO: We should ideally return status etc, but we dont' use that yet.
|
||||
return output, nil // TODO: We should ideally return status etc, but we don't' use that yet.
|
||||
}
|
||||
|
||||
func (r *Route53APIStub) ListHostedZonesPages(input *route53.ListHostedZonesInput, fn func(p *route53.ListHostedZonesOutput, lastPage bool) (shouldContinue bool)) error {
|
||||
|
@ -25,7 +25,7 @@ package stubs
|
||||
import dns "google.golang.org/api/dns/v1"
|
||||
|
||||
type (
|
||||
// TODO: We dont' need these yet, so they remain unimplemented. Add later as required.
|
||||
// TODO: We don't need these yet, so they remain unimplemented. Add later as required.
|
||||
Project struct{ impl *dns.Project }
|
||||
ProjectsGetCall struct{ impl *dns.ProjectsGetCall }
|
||||
ProjectsService struct{ impl *dns.ProjectsService }
|
||||
|
@ -30,7 +30,7 @@ type ManagedZonesDeleteCall struct {
|
||||
Service *ManagedZonesService
|
||||
Project string
|
||||
ZoneName string
|
||||
Error *error // Use this to overide response for testing if required
|
||||
Error *error // Use this to override response for testing if required
|
||||
}
|
||||
|
||||
func (call ManagedZonesDeleteCall) Do(opts ...googleapi.CallOption) error {
|
||||
|
@ -28,8 +28,8 @@ type ManagedZonesGetCall struct {
|
||||
Service *ManagedZonesService
|
||||
Project string
|
||||
ZoneName string
|
||||
Response interfaces.ManagedZone // Use this to overide response if required
|
||||
Error *error // Use this to overide response if required
|
||||
Response interfaces.ManagedZone // Use this to override response if required
|
||||
Error *error // Use this to override response if required
|
||||
DnsName_ string
|
||||
}
|
||||
|
||||
|
@ -29,8 +29,8 @@ var _ interfaces.ManagedZonesListCall = &ManagedZonesListCall{}
|
||||
type ManagedZonesListCall struct {
|
||||
Service *ManagedZonesService
|
||||
Project string
|
||||
Response *interfaces.ManagedZonesListResponse // Use this to overide response if required
|
||||
Error *error // Use this to overide response if required
|
||||
Response *interfaces.ManagedZonesListResponse // Use this to override response if required
|
||||
Error *error // Use this to override response if required
|
||||
DnsName_ string
|
||||
}
|
||||
|
||||
|
@ -45,12 +45,12 @@ const (
|
||||
)
|
||||
|
||||
type IngressController struct {
|
||||
// For triggering single ingress reconcilation. This is used when there is an
|
||||
// For triggering single ingress reconciliation. This is used when there is an
|
||||
// add/update/delete operation on an ingress in either federated API server or
|
||||
// in some member of the federation.
|
||||
ingressDeliverer *util.DelayingDeliverer
|
||||
|
||||
// For triggering reconcilation of all ingresses. This is used when
|
||||
// For triggering reconciliation of all ingresses. This is used when
|
||||
// a new cluster becomes available.
|
||||
clusterDeliverer *util.DelayingDeliverer
|
||||
|
||||
@ -94,7 +94,7 @@ func NewIngressController(client federation_release_1_4.Interface) *IngressContr
|
||||
eventRecorder: recorder,
|
||||
}
|
||||
|
||||
// Build deliverers for triggering reconcilations.
|
||||
// Build deliverers for triggering reconciliations.
|
||||
ic.ingressDeliverer = util.NewDelayingDeliverer()
|
||||
ic.clusterDeliverer = util.NewDelayingDeliverer()
|
||||
|
||||
@ -131,8 +131,8 @@ func NewIngressController(client federation_release_1_4.Interface) *IngressContr
|
||||
},
|
||||
&extensions_v1beta1.Ingress{},
|
||||
controller.NoResyncPeriodFunc(),
|
||||
// Trigger reconcilation whenever something in federated cluster is changed. In most cases it
|
||||
// would be just confirmation that some ingress operation suceeded.
|
||||
// Trigger reconciliation whenever something in federated cluster is changed. In most cases it
|
||||
// would be just confirmation that some ingress operation succeeded.
|
||||
util.NewTriggerOnAllChanges(
|
||||
func(obj pkg_runtime.Object) {
|
||||
ic.deliverIngressObj(obj, ic.ingressReviewDelay, false)
|
||||
@ -219,7 +219,7 @@ func (ic *IngressController) deliverIngress(ingress types.NamespacedName, delay
|
||||
}
|
||||
|
||||
// Check whether all data stores are in sync. False is returned if any of the informer/stores is not yet
|
||||
// synced with the coresponding api server.
|
||||
// synced with the corresponding api server.
|
||||
func (ic *IngressController) isSynced() bool {
|
||||
if !ic.ingressFederatedInformer.ClustersSynced() {
|
||||
glog.V(2).Infof("Cluster list not synced")
|
||||
@ -238,7 +238,7 @@ func (ic *IngressController) isSynced() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// The function triggers reconcilation of all federated ingresses.
|
||||
// The function triggers reconciliation of all federated ingresses.
|
||||
func (ic *IngressController) reconcileIngressesOnClusterChange() {
|
||||
glog.V(4).Infof("Reconciling ingresses on cluster change")
|
||||
if !ic.isSynced() {
|
||||
|
@ -46,12 +46,12 @@ const (
|
||||
)
|
||||
|
||||
type NamespaceController struct {
|
||||
// For triggering single namespace reconcilation. This is used when there is an
|
||||
// For triggering single namespace reconciliation. This is used when there is an
|
||||
// add/update/delete operation on a namespace in either federated API server or
|
||||
// in some member of the federation.
|
||||
namespaceDeliverer *util.DelayingDeliverer
|
||||
|
||||
// For triggering all namespaces reconcilation. This is used when
|
||||
// For triggering all namespaces reconciliation. This is used when
|
||||
// a new cluster becomes available.
|
||||
clusterDeliverer *util.DelayingDeliverer
|
||||
|
||||
@ -95,7 +95,7 @@ func NewNamespaceController(client federation_release_1_4.Interface) *NamespaceC
|
||||
eventRecorder: recorder,
|
||||
}
|
||||
|
||||
// Build delivereres for triggering reconcilations.
|
||||
// Build delivereres for triggering reconciliations.
|
||||
nc.namespaceDeliverer = util.NewDelayingDeliverer()
|
||||
nc.clusterDeliverer = util.NewDelayingDeliverer()
|
||||
|
||||
@ -128,8 +128,8 @@ func NewNamespaceController(client federation_release_1_4.Interface) *NamespaceC
|
||||
},
|
||||
&api_v1.Namespace{},
|
||||
controller.NoResyncPeriodFunc(),
|
||||
// Trigger reconcilation whenever something in federated cluster is changed. In most cases it
|
||||
// would be just confirmation that some namespace opration suceeded.
|
||||
// Trigger reconciliation whenever something in federated cluster is changed. In most cases it
|
||||
// would be just confirmation that some namespace opration succeeded.
|
||||
util.NewTriggerOnMetaAndSpecChanges(
|
||||
func(obj pkg_runtime.Object) { nc.deliverNamespaceObj(obj, nc.namespaceReviewDelay, false) },
|
||||
))
|
||||
@ -204,7 +204,7 @@ func (nc *NamespaceController) deliverNamespace(namespace string, delay time.Dur
|
||||
}
|
||||
|
||||
// Check whether all data stores are in sync. False is returned if any of the informer/stores is not yet
|
||||
// synced with the coresponding api server.
|
||||
// synced with the corresponding api server.
|
||||
func (nc *NamespaceController) isSynced() bool {
|
||||
if !nc.namespaceFederatedInformer.ClustersSynced() {
|
||||
glog.V(2).Infof("Cluster list not synced")
|
||||
@ -221,7 +221,7 @@ func (nc *NamespaceController) isSynced() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// The function triggers reconcilation of all federated namespaces.
|
||||
// The function triggers reconciliation of all federated namespaces.
|
||||
func (nc *NamespaceController) reconcileNamespacesOnClusterChange() {
|
||||
if !nc.isSynced() {
|
||||
nc.clusterDeliverer.DeliverAfter(allClustersKey, nil, nc.clusterAvailableDelay)
|
||||
|
@ -54,7 +54,7 @@ func NewPlanner(preferences *fed_api.FederatedReplicaSetPreferences) *Planner {
|
||||
}
|
||||
|
||||
// Distribute the desired number of replicas among the given cluster according to the planner preferences.
|
||||
// The function tries its best to assign each cluster the prefered number of replicas, however if
|
||||
// The function tries its best to assign each cluster the preferred number of replicas, however if
|
||||
// sum of MinReplicas for all cluster is bigger thant replicasToDistribute then some cluster will not
|
||||
// have all of the replicas assigned. In such case a cluster with higher weight has priority over
|
||||
// cluster with lower weight (or with lexicographically smaller name in case of draw).
|
||||
|
@ -44,12 +44,12 @@ const (
|
||||
)
|
||||
|
||||
type SecretController struct {
|
||||
// For triggering single secret reconcilation. This is used when there is an
|
||||
// For triggering single secret reconciliation. This is used when there is an
|
||||
// add/update/delete operation on a secret in either federated API server or
|
||||
// in some member of the federation.
|
||||
secretDeliverer *util.DelayingDeliverer
|
||||
|
||||
// For triggering all secrets reconcilation. This is used when
|
||||
// For triggering all secrets reconciliation. This is used when
|
||||
// a new cluster becomes available.
|
||||
clusterDeliverer *util.DelayingDeliverer
|
||||
|
||||
@ -93,7 +93,7 @@ func NewSecretController(client federation_release_1_4.Interface) *SecretControl
|
||||
eventRecorder: recorder,
|
||||
}
|
||||
|
||||
// Build delivereres for triggering reconcilations.
|
||||
// Build delivereres for triggering reconciliations.
|
||||
secretcontroller.secretDeliverer = util.NewDelayingDeliverer()
|
||||
secretcontroller.clusterDeliverer = util.NewDelayingDeliverer()
|
||||
|
||||
@ -126,8 +126,8 @@ func NewSecretController(client federation_release_1_4.Interface) *SecretControl
|
||||
},
|
||||
&api_v1.Secret{},
|
||||
controller.NoResyncPeriodFunc(),
|
||||
// Trigger reconcilation whenever something in federated cluster is changed. In most cases it
|
||||
// would be just confirmation that some secret opration suceeded.
|
||||
// Trigger reconciliation whenever something in federated cluster is changed. In most cases it
|
||||
// would be just confirmation that some secret opration succeeded.
|
||||
util.NewTriggerOnAllChanges(
|
||||
func(obj pkg_runtime.Object) {
|
||||
secretcontroller.deliverSecretObj(obj, secretcontroller.secretReviewDelay, false)
|
||||
@ -216,7 +216,7 @@ func (secretcontroller *SecretController) deliverSecret(namespace string, name s
|
||||
}
|
||||
|
||||
// Check whether all data stores are in sync. False is returned if any of the informer/stores is not yet
|
||||
// synced with the coresponding api server.
|
||||
// synced with the corresponding api server.
|
||||
func (secretcontroller *SecretController) isSynced() bool {
|
||||
if !secretcontroller.secretFederatedInformer.ClustersSynced() {
|
||||
glog.V(2).Infof("Cluster list not synced")
|
||||
@ -233,7 +233,7 @@ func (secretcontroller *SecretController) isSynced() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// The function triggers reconcilation of all federated secrets.
|
||||
// The function triggers reconciliation of all federated secrets.
|
||||
func (secretcontroller *SecretController) reconcileSecretsOnClusterChange() {
|
||||
if !secretcontroller.isSynced() {
|
||||
secretcontroller.clusterDeliverer.DeliverAt(allClustersKey, nil, time.Now().Add(secretcontroller.clusterAvailableDelay))
|
||||
|
@ -126,7 +126,7 @@ func getRrset(dnsName string, rrsetsInterface dnsprovider.ResourceRecordSets) (d
|
||||
return returnVal, nil
|
||||
}
|
||||
|
||||
/* getResolvedEndpoints perfoms DNS resolution on the provided slice of endpoints (which might be DNS names or IPv4 addresses)
|
||||
/* getResolvedEndpoints performs DNS resolution on the provided slice of endpoints (which might be DNS names or IPv4 addresses)
|
||||
and returns a list of IPv4 addresses. If any of the endpoints are neither valid IPv4 addresses nor resolvable DNS names,
|
||||
non-nil error is also returned (possibly along with a partially complete list of resolved endpoints.
|
||||
*/
|
||||
@ -135,7 +135,7 @@ func getResolvedEndpoints(endpoints []string) ([]string, error) {
|
||||
for _, endpoint := range endpoints {
|
||||
if net.ParseIP(endpoint) == nil {
|
||||
// It's not a valid IP address, so assume it's a DNS name, and try to resolve it,
|
||||
// replacing it's DNS name with it's IP addresses in expandedEndpoints
|
||||
// replacing its DNS name with its IP addresses in expandedEndpoints
|
||||
ipAddrs, err := net.LookupHost(endpoint)
|
||||
if err != nil {
|
||||
return resolvedEndpoints, err
|
||||
|
@ -62,7 +62,7 @@ func BuildClusterConfig(c *federation_v1beta1.Cluster) (*restclient.Config, erro
|
||||
}
|
||||
if serverAddress != "" {
|
||||
if c.Spec.SecretRef == nil {
|
||||
glog.Infof("didnt find secretRef for cluster %s. Trying insecure access", c.Name)
|
||||
glog.Infof("didn't find secretRef for cluster %s. Trying insecure access", c.Name)
|
||||
clusterConfig, err = clientcmd.BuildConfigFromFlags(serverAddress, "")
|
||||
} else {
|
||||
kubeconfigGetter := KubeconfigGetterForCluster(c)
|
||||
@ -78,14 +78,14 @@ func BuildClusterConfig(c *federation_v1beta1.Cluster) (*restclient.Config, erro
|
||||
}
|
||||
|
||||
// This is to inject a different kubeconfigGetter in tests.
|
||||
// We dont use the standard one which calls NewInCluster in tests to avoid having to setup service accounts and mount files with secret tokens.
|
||||
// We don't use the standard one which calls NewInCluster in tests to avoid having to setup service accounts and mount files with secret tokens.
|
||||
var KubeconfigGetterForCluster = func(c *federation_v1beta1.Cluster) clientcmd.KubeconfigGetter {
|
||||
return func() (*clientcmdapi.Config, error) {
|
||||
secretRefName := ""
|
||||
if c.Spec.SecretRef != nil {
|
||||
secretRefName = c.Spec.SecretRef.Name
|
||||
} else {
|
||||
glog.Infof("didnt find secretRef for cluster %s. Trying insecure access", c.Name)
|
||||
glog.Infof("didn't find secretRef for cluster %s. Trying insecure access", c.Name)
|
||||
}
|
||||
return KubeconfigGetterForSecret(secretRefName)()
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ import (
|
||||
)
|
||||
|
||||
// Basic test for Federated Informer. Checks whether the subinformer are added and deleted
|
||||
// when the corresponding cluster entries appear and dissapear from etcd.
|
||||
// when the corresponding cluster entries appear and disappear from etcd.
|
||||
func TestFederatedInformer(t *testing.T) {
|
||||
fakeFederationClient := &fake_federation_release_1_4.Clientset{}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user