add service mesh controller

add service mesh metrics

remove unused circle yaml

fix travis misconfiguration

fix travis misconfiguration

fix travis misconfiguration
This commit is contained in:
jeff
2019-03-08 18:22:30 +08:00
committed by Jeff
parent 858facd4b2
commit 4ac20ffc2b
1709 changed files with 344390 additions and 60749 deletions

View File

@@ -0,0 +1,52 @@
/*
Copyright 2018 The Kubernetes 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 component
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"reflect"
"strings"
)
// Constants defining labels
const (
LabelCR = "custom-resource"
LabelCRName = "custom-resource-name"
LabelCRNamespace = "custom-resource-namespace"
LabelComponent = "component"
)
// Labels return
func Labels(cr metav1.Object, component string) map[string]string {
return map[string]string{
LabelCR: strings.Trim(reflect.TypeOf(cr).String(), "*"),
LabelCRName: cr.GetName(),
LabelCRNamespace: cr.GetNamespace(),
LabelComponent: component,
}
}
// Labels return the common labels for a resource
func (c *Component) Labels() map[string]string {
return Labels(c.CR, c.Name)
}
// Merge is used to merge multiple maps into the target map
func (out KVMap) Merge(kvmaps ...KVMap) {
for _, kvmap := range kvmaps {
for k, v := range kvmap {
out[k] = v
}
}
}

View File

@@ -0,0 +1,18 @@
/*
Copyright 2018 The Kubernetes 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 component contains component definition
package component

View File

@@ -0,0 +1,31 @@
/*
Copyright 2018 The Kubernetes 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 component
import (
"github.com/kubernetes-sigs/application/pkg/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
)
// Handle is an interface for operating on logical Components of a CR
type Handle interface {
DependentResources(rsrc interface{}) *resource.ObjectBag
ExpectedResources(rsrc interface{}, labels map[string]string, dependent, aggregated *resource.ObjectBag) (*resource.ObjectBag, error)
Observables(scheme *runtime.Scheme, rsrc interface{}, labels map[string]string, expected *resource.ObjectBag) []resource.Observable
Mutate(rsrc interface{}, rsrclabels map[string]string, status interface{}, expected, dependent, observed *resource.ObjectBag) (*resource.ObjectBag, error)
Differs(expected metav1.Object, observed metav1.Object) bool
UpdateComponentStatus(rsrc, status interface{}, reconciled *resource.ObjectBag, err error)
Finalize(rsrc, status interface{}, observed *resource.ObjectBag) error
}

View File

@@ -0,0 +1,35 @@
/*
Copyright 2018 The Kubernetes 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 component
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// Common const definitions
const (
LifecycleManaged = "managed"
LifecycleReferred = "referred"
)
// Component represents a logical collection of resources
type Component struct {
Handle
Name string
CR metav1.Object
OwnerRef *metav1.OwnerReference
}
// KVMap is a map[string]string
type KVMap map[string]string