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

Cherry-pick #5029 #5096 #5097 #5099 #5108 #5113 #5114 #5115 #5116 #5118 #5126 #5128 #5130 #5132

Merged
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
Update RELEASE to v0.48.5 (#5130)
Signed-off-by: Yoshiki Fujikane <[email protected]>
Signed-off-by: pipecd-bot <[email protected]>
ffjlabo authored and pipecd-bot committed Aug 13, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 2b2af9d06ce5b59113f3f2973261505ae6a6f0b4
2 changes: 1 addition & 1 deletion RELEASE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tag: v0.48.4
tag: v0.48.5

releaseNoteGenerator:
showCommitter: false

Unchanged files with check annotations Beta

panic(fmt.Sprintf("failed to detect the current user's home directory: %v", err))
}
p := &piped{
adminPort: 9085,
toolsDir: path.Join(home, ".piped", "tools"),
gracePeriod: 30 * time.Second,
maxRecvMsgSize: 1024 * 1024 * 10, // 10MB
appManifestCacheCount: 150,

Check warning on line 119 in pkg/app/piped/cmd/piped/piped.go

Codecov / codecov/patch

pkg/app/piped/cmd/piped/piped.go#L115-L119

Added lines #L115 - L119 were not covered by tests
}
cmd := &cobra.Command{
Use: "piped",
cmd.Flags().BoolVar(&p.enableDefaultKubernetesCloudProvider, "enable-default-kubernetes-cloud-provider", p.enableDefaultKubernetesCloudProvider, "Whether the default kubernetes provider is enabled or not. This feature is deprecated.")
cmd.Flags().BoolVar(&p.addLoginUserToPasswd, "add-login-user-to-passwd", p.addLoginUserToPasswd, "Whether to add login user to $HOME/passwd. This is typically for applications running as a random user ID.")
cmd.Flags().DurationVar(&p.gracePeriod, "grace-period", p.gracePeriod, "How long to wait for graceful shutdown.")
cmd.Flags().IntVar(&p.appManifestCacheCount, "app-manifest-cache-count", p.appManifestCacheCount, "The number of app manifests to cache. The cache-key contains the commit hash. The default is 150.")

Check warning on line 140 in pkg/app/piped/cmd/piped/piped.go

Codecov / codecov/patch

pkg/app/piped/cmd/piped/piped.go#L140

Added line #L140 was not covered by tests
cmd.Flags().StringVar(&p.launcherVersion, "launcher-version", p.launcherVersion, "The version of launcher which initialized this Piped.")
return err
}
tracerProvider, err := p.createTracerProvider(ctx, cfg.APIAddress, cfg.ProjectID, cfg.PipedID, pipedKey)
if err != nil {
input.Logger.Error("failed to create tracer provider", zap.Error(err))
return err
}
otel.SetTracerProvider(tracerProvider)

Check warning on line 243 in pkg/app/piped/cmd/piped/piped.go

Codecov / codecov/patch

pkg/app/piped/cmd/piped/piped.go#L237-L243

Added lines #L237 - L243 were not covered by tests
// Send the newest piped meta to the control-plane.
if err := p.sendPipedMeta(ctx, apiClient, cfg, input.Logger); err != nil {
input.Logger.Error("failed to report piped meta to control-plane", zap.Error(err))
analysisResultStore := analysisresultstore.NewStore(apiClient, input.Logger)
// Create memory caches.
appManifestsCache, err := memorycache.NewLRUCache(p.appManifestCacheCount)
if err != nil {
input.Logger.Error("failed to create app manifests cache", zap.Error(err))
return err
}

Check warning on line 365 in pkg/app/piped/cmd/piped/piped.go

Codecov / codecov/patch

pkg/app/piped/cmd/piped/piped.go#L361-L365

Added lines #L361 - L365 were not covered by tests
var liveStateGetter livestatestore.Getter
// Start running application live state store.
}
// createTracerProvider makes a OpenTelemetry Trace's TracerProvider.
func (p *piped) createTracerProvider(ctx context.Context, address, projectID, pipeID string, pipedKey []byte) (trace.TracerProvider, error) {
options := []otlptracegrpc.Option{
otlptracegrpc.WithEndpoint(address),
otlptracegrpc.WithHeaders(map[string]string{
"authorization": "Bearer " + rpcauth.MakePipedToken(projectID, pipeID, string(pipedKey)),
}),
}
if !p.insecure {
if p.certFile != "" {
creds, err := credentials.NewClientTLSFromFile(p.certFile, "")
if err != nil {
return nil, fmt.Errorf("failed to load client TLS credentials: %w", err)
}
options = append(options, otlptracegrpc.WithTLSCredentials(creds))
} else {
config := &tls.Config{}
options = append(options, otlptracegrpc.WithTLSCredentials(credentials.NewTLS(config)))
}
} else {
options = append(options, otlptracegrpc.WithInsecure())
}

Check warning on line 619 in pkg/app/piped/cmd/piped/piped.go

Codecov / codecov/patch

pkg/app/piped/cmd/piped/piped.go#L598-L619

Added lines #L598 - L619 were not covered by tests
otlpTraceExporter, err := otlptracegrpc.New(ctx, options...)
if err != nil {
return nil, err
}

Check warning on line 624 in pkg/app/piped/cmd/piped/piped.go

Codecov / codecov/patch

pkg/app/piped/cmd/piped/piped.go#L621-L624

Added lines #L621 - L624 were not covered by tests
return sdktrace.NewTracerProvider(
sdktrace.WithBatcher(otlpTraceExporter),
sdktrace.WithSampler(sdktrace.AlwaysSample()),
), nil

Check warning on line 629 in pkg/app/piped/cmd/piped/piped.go

Codecov / codecov/patch

pkg/app/piped/cmd/piped/piped.go#L626-L629

Added lines #L626 - L629 were not covered by tests
}
// loadConfig reads the Piped configuration data from the specified source.