Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update SvcAnnotations to ServiceAnnotations
  • Loading branch information
iyacontrol committed Feb 15, 2019
commit 213dee3821a0db2c215dc597f0b42b5895b62c3b
5 changes: 3 additions & 2 deletions src/backend/controllers/common/ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package common

import (
"github.com/Qihoo360/wayne/src/backend/models"

kapiv1beta1 "k8s.io/api/extensions/v1beta1"
Comment thread
chengyumeng marked this conversation as resolved.
)

Expand All @@ -14,11 +15,11 @@ func IngressPreDeploy(kubeIngress *kapiv1beta1.Ingress, cluster *models.Cluster,
preDefinedAnnotationMap[k] = v
}
// cluster defined, overwrite user defined
for k, v := range cluster.MetaDataObj.SvcAnnotations {
for k, v := range cluster.MetaDataObj.ServiceAnnotations {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ingress 为什么引用 ServiceAnnotations ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix it

preDefinedAnnotationMap[k] = v
}
// namespace defined, overwrite cluster and user defined
for k, v := range namespace.MetaDataObj.SvcAnnotations {
for k, v := range namespace.MetaDataObj.ServiceAnnotations {
preDefinedAnnotationMap[k] = v
}
for k, v := range preDefinedAnnotationMap {
Expand Down
2 changes: 1 addition & 1 deletion src/backend/models/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ type ClusterMetaData struct {
// current cluster image pull secrets, will be overwrite by namespace's ImagePullSecrets
ImagePullSecrets []v1.LocalObjectReference `json:"imagePullSecrets"`
// 默认添加service注解,会在发布资源时在每个service添加此Annotations, will be overwrite by namespace's Annotations
SvcAnnotations map[string]string `json:"svcAnnotations,omitempty"`
ServiceAnnotations map[string]string `json:"serviceAnnotations,omitempty"`
// 默认添加ingress注解,会在发布资源时在每个ingress添加此Annotations, will be overwrite by namespace's Annotations
IngressAnnotations map[string]string `json:"ingressAnnotations,omitempty"`
}
Expand Down
2 changes: 1 addition & 1 deletion src/backend/models/namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ type NamespaceMetaData struct {
// current namespace image pull secrets, will overwrite cluster's ImagePullSecrets
ImagePullSecrets []v1.LocalObjectReference `json:"imagePullSecrets"`
// current namespace service annotation, will overwrite cluster service's Annotation
SvcAnnotations map[string]string `json:"svcAnnotations,omitempty"`
ServiceAnnotations map[string]string `json:"serviceAnnotations,omitempty"`
// current namespace ingress annotation, will overwrite cluster ingress's Annotation
IngressAnnotations map[string]string `json:"ingressAnnotations,omitempty"`
}
Expand Down