Skip to content

Commit

Permalink
Merge pull request #32 from vanus-labs/panic
Browse files Browse the repository at this point in the history
fix: upgrade operator panic
  • Loading branch information
hwjiangkai authored Mar 20, 2023
2 parents df5dbb9 + f7de9eb commit f991697
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions controllers/connector_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,9 @@ func (r *ConnectorReconciler) generateIngressForConnector(connector *vanusv1alph
}

func ExplicitConnectorAnnotations(connector *vanusv1alpha1.Connector) {
if connector.Annotations == nil {
connector.Annotations = make(map[string]string)
}
ExplicitConectorAnnotationWithDefaultValue(connector, cons.ConnectorDeploymentReplicasAnnotation, fmt.Sprintf("%d", cons.DefaultConnectorReplicas))
ExplicitConectorAnnotationWithDefaultValue(connector, cons.ConnectorServiceTypeAnnotation, cons.DefaultConnectorServiceType)
ExplicitConectorAnnotationWithDefaultValue(connector, cons.ConnectorServicePortAnnotation, fmt.Sprintf("%d", cons.DefaultConnectorServicePort))
Expand Down
3 changes: 3 additions & 0 deletions controllers/core_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ func (r *CoreReconciler) SetupWithManager(mgr ctrl.Manager) error {
}

func ExplicitCoreAnnotations(core *vanusv1alpha1.Core) {
if core.Annotations == nil {
core.Annotations = make(map[string]string)
}
ExplicitCoreAnnotationWithDefaultValue(core, cons.CoreComponentEtcdPortClientAnnotation, fmt.Sprintf("%d", cons.DefaultEtcdPortClient))
ExplicitCoreAnnotationWithDefaultValue(core, cons.CoreComponentEtcdPortPeerAnnotation, fmt.Sprintf("%d", cons.DefaultEtcdPortPeer))
ExplicitCoreAnnotationWithDefaultValue(core, cons.CoreComponentEtcdStorageSizeAnnotation, cons.DefaultEtcdStorageSize)
Expand Down

0 comments on commit f991697

Please sign in to comment.