astefanutti commented on code in PR #2835:
URL: https://github.com/apache/camel-k/pull/2835#discussion_r841572845
##########
pkg/cmd/run.go:
##########
@@ -735,3 +780,350 @@ func resolvePodTemplate(ctx context.Context, templateSrc
string, spec *v1.Integr
}
return err
}
+
+func getPlatform(context context.Context, c client.Client, ns string)
(*v1.IntegrationPlatform, error) {
+ list := v1.NewIntegrationPlatformList()
+ if err := c.List(context, &list, ctrl.InNamespace(ns)); err != nil {
+ return nil, errors.Wrap(err, fmt.Sprintf("could not retrieve
integration platform from namespace %s", ns))
+ }
+ if len(list.Items) > 1 {
Review Comment:
Should that rather be the active Platform?
##########
pkg/cmd/run.go:
##########
@@ -561,8 +578,36 @@ func (o *runCmdOptions) createOrUpdateIntegration(cmd
*cobra.Command, c client.C
return nil, err
}
+ var platform *v1.IntegrationPlatform
for _, item := range o.Dependencies {
- integration.Spec.AddDependency(item)
+ // TODO: accept URLs
+ if strings.HasPrefix(item, "file://") {
+ if platform == nil {
+ // let's also enable the registry trait if not
explicitly disabled
+ if !contains(o.Traits,
"registry.enabled=false") {
+ o.Traits = append(o.Traits,
"registry.enabled=true")
+ }
+ platform, err = getPlatform(o.Context, c,
integration.Namespace)
+ if err != nil {
+ return nil, err
+ }
+ if platform.Spec.Build.Registry.CA != "" {
+ fmt.Printf("We've noticed the image
registry is configured with a custom certificate [%s] \n",
platform.Spec.Build.Registry.CA)
+ fmt.Println("Please make sure Node.js
is configured to use it or the operation will fail.")
Review Comment:
Node.js?
##########
pkg/apis/camel/v1/maven_types.go:
##########
@@ -30,16 +32,17 @@ type MavenSpec struct {
// A reference to the ConfigMap or Secret key that contains
// the Maven settings.
Settings ValueSource `json:"settings,omitempty"`
- // The Secret name and key, containing the CA certificate(s) used to
connect
+ // The Secrets name and key, containing the CA certificate(s) used to
connect
// to remote Maven repositories.
// It can contain X.509 certificates, and PKCS#7 formatted certificate
chains.
// A JKS formatted keystore is automatically created to store the CA
certificate(s),
// and configured to be used as a trusted certificate(s) by the Maven
commands.
// Note that the root CA certificates are also imported into the
created keystore.
- CASecret *corev1.SecretKeySelector `json:"caSecret,omitempty"`
+ CASecret []corev1.SecretKeySelector `json:"caSecret,omitempty"`
// The Maven build extensions.
// See https://maven.apache.org/guides/mini/guide-using-extensions.html.
Extension []MavenArtifact `json:"extension,omitempty"`
+ Servers []Server `json:"servers,omitempty"`
Review Comment:
Can that be also provided in the user Maven settings?
##########
pkg/util/camel/camel_dependencies.go:
##########
@@ -102,6 +104,31 @@ func addDependencies(project *maven.Project, dependencies
[]string, catalog *Run
gav := strings.TrimPrefix(d, "mvn:")
project.AddEncodedDependencyGAV(gav)
+ case strings.HasPrefix(d, "docker-mvn:"):
Review Comment:
`registry-mvn`?
##########
pkg/apis/camel/v1/maven_types.go:
##########
@@ -30,16 +32,17 @@ type MavenSpec struct {
// A reference to the ConfigMap or Secret key that contains
// the Maven settings.
Settings ValueSource `json:"settings,omitempty"`
- // The Secret name and key, containing the CA certificate(s) used to
connect
+ // The Secrets name and key, containing the CA certificate(s) used to
connect
// to remote Maven repositories.
// It can contain X.509 certificates, and PKCS#7 formatted certificate
chains.
// A JKS formatted keystore is automatically created to store the CA
certificate(s),
// and configured to be used as a trusted certificate(s) by the Maven
commands.
// Note that the root CA certificates are also imported into the
created keystore.
- CASecret *corev1.SecretKeySelector `json:"caSecret,omitempty"`
+ CASecret []corev1.SecretKeySelector `json:"caSecret,omitempty"`
Review Comment:
Is it backward compatible? If not, maybe a `CASecrets` field could be added
and the old one marked as deprecated.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]