ingress-nginx-helm/core/pkg/ingress/annotations/secureupstream/main.go

42 lines
1.1 KiB
Go
Raw Normal View History

2016-06-01 18:47:37 +00:00
/*
Copyright 2016 The Kubernetes Authors.
2016-06-01 18:47:37 +00:00
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 secureupstream
import (
2017-04-01 14:39:42 +00:00
extensions "k8s.io/client-go/pkg/apis/extensions/v1beta1"
2016-11-16 18:24:26 +00:00
"k8s.io/ingress/core/pkg/ingress/annotations/parser"
2016-06-01 18:47:37 +00:00
)
const (
secureUpstream = "ingress.kubernetes.io/secure-backends"
2016-06-01 18:47:37 +00:00
)
type su struct {
}
// NewParser creates a new secure upstream annotation parser
func NewParser() parser.IngressAnnotation {
return su{}
}
// Parse parses the annotations contained in the ingress
2016-06-01 18:47:37 +00:00
// rule used to indicate if the upstream servers should use SSL
func (a su) Parse(ing *extensions.Ingress) (interface{}, error) {
return parser.GetBoolAnnotation(secureUpstream, ing)
2016-06-01 18:47:37 +00:00
}