Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:修复javaagent注入配置存在问题 #187

Merged
merged 2 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions cmd/polaris-controller/app/polaris-controller-manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions pkg/inject/pkg/kube/inject/inject.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
5 changes: 3 additions & 2 deletions pkg/inject/pkg/kube/inject/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion sidecar/polaris-sidecar-init/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading