func()

in appconfigmgrv2/api/webhooks/builtins/pod_webhook.go [246:259]


func (a *podAnnotator) handleGCPSecretIfNeeded(ctx context.Context, pod *corev1.Pod, app *appconfig.AppEnvConfigTemplateV2) error {
	log.Info("podAnnotator:handleGCPSecretIfNeeded")
	switch {
	case app.Spec.Auth == nil, app.Spec.Auth.GCPAccess == nil:
		return nil
	case app.Spec.Auth.GCPAccess.AccessType == "vault":
		return a.handleGCPVault(ctx, pod, app)
	case app.Spec.Auth.GCPAccess.AccessType == "secret":
		return a.handleGCPSecret(ctx, pod, app)
	default:
		log.Error(fmt.Errorf("invalid GCPAccess value"), "\"%s\"", app.Spec.Auth.GCPAccess.AccessType)
		return nil
	}
}