From 288fce01395801a263aec0d928647b7543eee14d Mon Sep 17 00:00:00 2001 From: chuntaojun Date: Tue, 19 Mar 2024 11:15:08 +0800 Subject: [PATCH 1/2] stash --- Makefile | 2 +- cmd/polaris-controller/app/polaris-controller-manager.go | 2 ++ sidecar/polaris-sidecar-init/Dockerfile | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3c8ab57e..5f2fcb55 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ ORG = polarismesh REPO = polaris-controller SIDECAR_INIT_REPO = polaris-sidecar-init ENVOY_SIDECAR_INIT_REPO = polaris-envoy-bootstrap-generator -IMAGE_TAG = v1.7.0-alpha.3 +IMAGE_TAG = v1.7.1 PLATFORMS = linux/amd64,linux/arm64 .PHONY: all diff --git a/cmd/polaris-controller/app/polaris-controller-manager.go b/cmd/polaris-controller/app/polaris-controller-manager.go index 757c0d4a..835758d8 100644 --- a/cmd/polaris-controller/app/polaris-controller-manager.go +++ b/cmd/polaris-controller/app/polaris-controller-manager.go @@ -577,6 +577,8 @@ func registerController(c *options.KubeControllerManagerConfiguration, provider req.Host = podIP req.Port = int(c.Generic.Port) req.SetTTL(5) + // 开启自动上报心跳 + req.AutoHeartbeat = true _, err := provider.RegisterInstance(req) if err != nil { diff --git a/sidecar/polaris-sidecar-init/Dockerfile b/sidecar/polaris-sidecar-init/Dockerfile index 0a9c164e..140214a3 100644 --- a/sidecar/polaris-sidecar-init/Dockerfile +++ b/sidecar/polaris-sidecar-init/Dockerfile @@ -13,7 +13,7 @@ # CONDITIONS OF ANY KIND, either express or implied. See the License for the # specific language governing permissions and limitations under the License. -FROM alpine:latest +FROM alpine:3.18.6 # Copy Startup Script COPY start.sh /start.sh From 94e1b64500b4a3b6f06f986fdfd2ac533e8718a8 Mon Sep 17 00:00:00 2001 From: chuntaojun Date: Wed, 26 Jun 2024 21:20:25 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8Djavaagent=E6=B3=A8?= =?UTF-8?q?=E5=85=A5=E9=85=8D=E7=BD=AE=E5=AD=98=E5=9C=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/inject/pkg/kube/inject/inject.go | 4 ++-- pkg/inject/pkg/kube/inject/webhook.go | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/inject/pkg/kube/inject/inject.go b/pkg/inject/pkg/kube/inject/inject.go index 5c4e0077..5facb858 100644 --- a/pkg/inject/pkg/kube/inject/inject.go +++ b/pkg/inject/pkg/kube/inject/inject.go @@ -613,11 +613,11 @@ func parseTemplate(tmplStr string, funcMap map[string]interface{}, data SidecarT temp := template.New("inject") t, err := temp.Funcs(funcMap).Parse(tmplStr) if err != nil { - log.InjectScope().Infof("Failed to parse template: %v %v\n", err, tmplStr) + log.InjectScope().Errorf("Failed to parse template: %v %v\n", err, tmplStr) return bytes.Buffer{}, err } if err := t.Execute(&tmpl, &data); err != nil { - log.InjectScope().Infof("Invalid template: %v %v\n", err, tmplStr) + log.InjectScope().Errorf("Invalid template: %v %v\n", err, tmplStr) return bytes.Buffer{}, err } diff --git a/pkg/inject/pkg/kube/inject/webhook.go b/pkg/inject/pkg/kube/inject/webhook.go index ebc14f66..3c324f8d 100644 --- a/pkg/inject/pkg/kube/inject/webhook.go +++ b/pkg/inject/pkg/kube/inject/webhook.go @@ -340,6 +340,7 @@ func (wh *Webhook) Run(stop <-chan struct{}) { sidecarMeshConfig := injectConf.MeshInjectConf sidecarDnsConfig := injectConf.DnsInjectConf + sidecarJavaagentConfig := injectConf.JavaAgentInjectConf meshConfig := injectConf.MeshConf valuesConfig := injectConf.ValuesConf @@ -348,8 +349,8 @@ func (wh *Webhook) Run(stop <-chan struct{}) { wh.sidecarMeshTemplateVersion = sidecarTemplateVersionHash(sidecarMeshConfig.Template) wh.sidecarDnsConfig = sidecarDnsConfig wh.sidecarDnsTemplateVersion = sidecarTemplateVersionHash(sidecarDnsConfig.Template) - wh.sidecarJavaAgentConfig = sidecarDnsConfig - wh.sidecarJavaAgentTemplateVersion = sidecarTemplateVersionHash(sidecarDnsConfig.Template) + wh.sidecarJavaAgentConfig = sidecarJavaagentConfig + wh.sidecarJavaAgentTemplateVersion = sidecarTemplateVersionHash(sidecarJavaagentConfig.Template) wh.valuesConfig = valuesConfig wh.meshConfig = meshConfig