Skip to content

Commit

Permalink
address lint warning
Browse files Browse the repository at this point in the history
  • Loading branch information
lichuqiang committed Oct 9, 2018
1 parent 04c88b5 commit f1e976a
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/apis/networking/v1alpha1/clusteringress_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

var (
DefaultTimeout = 60 * time.Second
const (
// Default to 60 seconds if timeout not specified.
DefaultTimeout = 60 * time.Second
// Default to retry for 3 times if not specified.
DefaultRetryCount = 3
)

Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/networking/v1alpha1/clusteringress_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,8 @@ func (cis *IngressStatus) MarkNetworkConfigured() {
clusterIngressCondSet.Manage(cis).MarkTrue(ClusterIngressConditionNetworkConfigured)
}

// MarkNetworkConfigurationMissing set ClusterIngressConditionNetworkConfigured to false
// with given message.
func (cis *IngressStatus) MarkNetworkConfigurationMissing(message string) {
clusterIngressCondSet.Manage(cis).MarkFalse(ClusterIngressConditionNetworkConfigured, "NetworkConfigurationMissing", message)
}
Expand Down
23 changes: 23 additions & 0 deletions pkg/reconciler/v1alpha1/clusteringress/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
Copyright 2018 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

/*
Package clusteringress implements a kubernetes controller which tracks ClusterIngress resource
and reconcile VirtualService as its child resource.
*/
package clusteringress
19 changes: 19 additions & 0 deletions pkg/reconciler/v1alpha1/clusteringress/resources/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
Copyright 2018 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Package resources holds simple functions for synthesizing child resources from
// a ClusterIngress resource and any relevant ClusterIngress controller configuration.
package resources
18 changes: 18 additions & 0 deletions pkg/reconciler/v1alpha1/clusteringress/resources/names/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
Copyright 2018 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Package names holds simple functions for synthesizing resource names.
package names
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,17 @@ import (
"github.com/knative/serving/pkg/system"
)

// K8sGatewayFullname is the fully-qualified name of Knative shared gateway.
var K8sGatewayFullname = reconciler.GetK8sServiceFullname(
"knative-shared-gateway",
system.Namespace)

// K8sGatewayServiceFullname is the fully-qualified name of in-cluster Knative gateway.
var K8sGatewayServiceFullname = reconciler.GetK8sServiceFullname(
"knative-ingressgateway",
"istio-system")

// VirtualService returns the name of the VirtualService child resource for given ClusterIngress.
func VirtualService(i *v1alpha1.ClusterIngress) string {
return i.Name
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ import (
"github.com/knative/serving/pkg/system"
)

// MakeVirtualService creates an Istio VirtualService as network programming.
// Such VirtualService specifies which Gateways and Hosts that it applies to,
// as well as the routing rules.
func MakeVirtualService(ci *v1alpha1.ClusterIngress) *v1alpha3.VirtualService {
return &v1alpha3.VirtualService{
ObjectMeta: metav1.ObjectMeta{
Expand Down
1 change: 1 addition & 0 deletions pkg/reconciler/v1alpha1/testing/listers.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ func (l *Listers) GetKPALister() kpalisters.PodAutoscalerLister {
return kpalisters.NewPodAutoscalerLister(l.indexerFor(&kpa.PodAutoscaler{}))
}

// GetClusterIngressLister get lister for ClusterIngress resource.
func (l *Listers) GetClusterIngressLister() networkinglisters.ClusterIngressLister {
return networkinglisters.NewClusterIngressLister(l.indexerFor(&networking.ClusterIngress{}))
}
Expand Down

0 comments on commit f1e976a

Please sign in to comment.