Skip to content

Commit 79cff25

Browse files
committed
- fixing up on the comments raised by on the review
1 parent 338a6d7 commit 79cff25

File tree

7 files changed

+11
-14
lines changed

7 files changed

+11
-14
lines changed

node-authorizer/pkg/authorizers/alwaysallow/authorizer.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,19 @@ import (
2525
// alwaysAllowAuth is the implementation for a node authozier
2626
type alwaysAllowAuth struct{}
2727

28-
// NewAuthorizer creates and returns a aws node authorizer
28+
// NewAuthorizer creates and returns a alwaysAllow node authorizer
2929
func NewAuthorizer() (server.Authorizer, error) {
3030
return &alwaysAllowAuth{}, nil
3131
}
3232

33-
// Admit is responsible for accepting the request
33+
// Authorize is responsible for accepting the request
3434
func (a *alwaysAllowAuth) Authorize(_ context.Context, req *server.NodeRegistration) error {
3535
req.Status.Allowed = true
3636

3737
return nil
3838
}
3939

40-
// Name returns the name of of the authozier
40+
// Name returns the name of the authorizer
4141
func (a *alwaysAllowAuth) Name() string {
4242
return "alwaysAllow"
4343
}

node-authorizer/pkg/authorizers/aws/authorizer.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ import (
4141

4242
const (
4343
// the default tag used to indicates a kubernetes cluster name
44-
kubenetesClusterTag = "KubernetesCluster"
44+
kubernetesClusterTag = "KubernetesCluster"
4545
)
4646

4747
// a collection of aws public signing certificates
4848
var publicCertificates []*x509.Certificate
4949

50-
// awsNodeAuthorizer is the implementation for a node authozier
50+
// awsNodeAuthorizer is the implementation for a node authorizer
5151
type awsNodeAuthorizer struct {
5252
// client is the ec2 interface
5353
client ec2iface.EC2API
@@ -157,7 +157,7 @@ func (a *awsNodeAuthorizer) validateNodeInstance(ctx context.Context, doc *ec2me
157157
}
158158

159159
// @check the instance is tagged with our kubernetes cluster id
160-
if !hasInstanceTags(kubenetesClusterTag, a.config.ClusterName, instance.Tags) {
160+
if !hasInstanceTags(kubernetesClusterTag, a.config.ClusterName, instance.Tags) {
161161
return "missing cluster tag", nil
162162
}
163163

node-authorizer/pkg/server/metrics.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var (
3030
authorizeRequestLatencyMetric = prometheus.NewSummary(
3131
prometheus.SummaryOpts{
3232
Name: "node_request_latency_seconds",
33-
Help: "A summary of the latency for incoming node authoriation requests",
33+
Help: "A summary of the latency for incoming node authorization requests",
3434
},
3535
)
3636
authorizerLatencyMetric = prometheus.NewSummary(

node-authorizer/pkg/server/types.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ type Token struct {
115115
type NodeRegistrationSpec struct {
116116
// NodeName is the name of the node
117117
NodeName string
118-
// RemoteaAddr is the address of the requester
118+
// RemoteAddr is the address of the requester
119119
RemoteAddr string
120120
// Request is the request body
121121
Request []byte
@@ -161,9 +161,6 @@ func (c *Config) IsValid() error {
161161
if c.TLSPrivateKeyPath == "" {
162162
return errors.New("no private key")
163163
}
164-
if c.Port <= 0 && c.Port >= 65535 {
165-
return errors.New("invalid port")
166-
}
167164

168165
return nil
169166
}

nodeup/pkg/model/node_authorizer.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func (b *NodeAuthorizationBuilder) Build(c *fi.ModelBuilderContext) error {
9292
glog.V(3).Infof("bootstrap: %t, node authorization: %t, node authorizer: %t", b.UseBootstrapTokens(),
9393
b.UseNodeAuthorization(), b.UseNodeAuthorizer())
9494

95-
// @check if the NodeAuhtorizer provision the client service for nodes
95+
// @check if the NodeAuthorizer provision the client service for nodes
9696
if b.UseNodeAuthorizer() && !b.IsMaster {
9797
na := b.Cluster.Spec.NodeAuthorization.NodeAuthorizer
9898

pkg/model/bootstrapscript.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ func (b *BootstrapScript) ResourceNodeUp(ig *kops.InstanceGroup, cluster *kops.C
138138
}
139139
if cs.KubeAPIServer.EnableBootstrapAuthToken != nil {
140140
spec["kubeAPIServer"] = map[string]interface{}{
141-
"enableBootstrapTokenAuth": cs.KubeAPIServer.EnableBootstrapAuthToken,
141+
"enableBootstrapAuthToken": cs.KubeAPIServer.EnableBootstrapAuthToken,
142142
}
143143
}
144144

upup/pkg/fi/cloudup/bootstrapchannelbuilder.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func (b *BootstrapChannelBuilder) buildManifest() (*channelsapi.Addons, map[stri
113113
// @check if podsecuritypolicies are enabled and if so, push the default kube-system policy
114114
if b.cluster.Spec.KubeAPIServer != nil && b.cluster.Spec.KubeAPIServer.HasAdmissionController("PodSecurityPolicy") {
115115
key := "podsecuritypolicy.addons.k8s.io"
116-
version := "0.0.3"
116+
version := "0.0.4"
117117

118118
{
119119
location := key + "/k8s-1.9.yaml"

0 commit comments

Comments
 (0)