From c449b65f95b7920b2b6df5e78dd81fa6b8f5a09a Mon Sep 17 00:00:00 2001 From: LaurenceLiZhixin <382673304@qq.com> Date: Thu, 18 Mar 2021 20:57:01 +0800 Subject: [PATCH] fix: add liscense --- config/uniform_router_config.go | 46 +++++++++++------------------ remoting/k8sCRD/client.go | 17 +++++++++++ remoting/k8sCRD/listener_handler.go | 17 +++++++++++ 3 files changed, 51 insertions(+), 29 deletions(-) diff --git a/config/uniform_router_config.go b/config/uniform_router_config.go index 3806b2c54..c4039d8d5 100644 --- a/config/uniform_router_config.go +++ b/config/uniform_router_config.go @@ -1,3 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 config import ( @@ -21,16 +38,6 @@ type VirtualServiceConfig struct { Spec UniformRouterConfigSpec `yaml:"spec" json:"spec"` } -//func (vsc *VirtualServiceConfig) ChangeJsonTab2YamlTabAndGetYamlByte() ([]byte, error) { -// data, err := json.Marshal(vsc) -// if err != nil { -// logger.Error("marshal virtual service config err:", err) -// return []byte{}, err -// } -// yaml.Unmarshal(data, vsc) -// -//} - type UniformRouterConfigSpec struct { Hosts []string `yaml:"hosts" json:"hosts"` Dubbo []*DubboRoute `yaml:"dubbo" json:"dubbo"` @@ -153,31 +160,12 @@ func (urc *VirtualServiceConfig) DeepCopyObject() runtime.Object { return out } -//func (drc *DestinationRuleSpec) DeepCopyObject() runtime.Object { -// data, _ := yaml.Marshal(drc) -// out := &DestinationRuleSpec{} -// yaml.Unmarshal(data, out) -// return out -//} - type DestinationRuleSpecList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []DestinationRuleSpec `json:"items"` } -//func (urc *DestinationRuleSpecList) DeepCopyObject() runtime.Object { -// out := &DestinationRuleSpecList{ -// TypeMeta: urc.TypeMeta, -// ListMeta: urc.ListMeta, -// } -// for _, v := range urc.Items { -// spec := v.DeepCopyObject().(*DestinationRuleSpec) -// out.Items = append(out.Items, *spec) -// } -// return out -//} - type VirtualServiceConfigList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` diff --git a/remoting/k8sCRD/client.go b/remoting/k8sCRD/client.go index 87fdd8cd8..3d4cfba8e 100644 --- a/remoting/k8sCRD/client.go +++ b/remoting/k8sCRD/client.go @@ -1,3 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 k8sCRD import ( diff --git a/remoting/k8sCRD/listener_handler.go b/remoting/k8sCRD/listener_handler.go index acaa8b332..e7f69c0fe 100644 --- a/remoting/k8sCRD/listener_handler.go +++ b/remoting/k8sCRD/listener_handler.go @@ -1,3 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 k8sCRD import ( -- GitLab