New command to list the custom packages#466
Conversation
cmoulliard
commented
Dec 24, 2024
- New command to list the custom packages
- See: Add list package(s) command #465
|
Example of what the code produce now Custom packages added What the command |
nabuskey
left a comment
There was a problem hiding this comment.
Can we add additional printer columns for the package type?
https://book.kubebuilder.io/reference/generating-crd#additional-printer-columns
https://github.com/cnoe-io/idpbuilder/blob/main/api/v1alpha1/custom_package_types.go
pkg/entity/package.go
Outdated
There was a problem hiding this comment.
Can we merge all structs in separate files into one file? Is the entity package for types? If so, we should name the package as types instead of entity.
There was a problem hiding this comment.
If so, we should name the package as
typesinstead ofentity.
types is a better name. I will rename. Fixed: 6415f7b
There was a problem hiding this comment.
Can we merge all structs in separate files into one file?
Why do you want to merge them into one file ? This is easier to figure out what it exists if you have one file/type under the folder name types
Yes but what do you want to print under this new column ? |
|
Question: Should we also add the column of the Argocd repo as we also have those for git or gitea repo ? |
Signed-off-by: cmoulliard <cmoulliard@redhat.com>
Signed-off-by: cmoulliard <cmoulliard@redhat.com>
…mPackages Signed-off-by: cmoulliard <cmoulliard@redhat.com>
Signed-off-by: cmoulliard <cmoulliard@redhat.com>
Co-authored-by: Manabu McCloskey <manabu.mccloskey@gmail.com> Signed-off-by: cmoulliard <cmoulliard@redhat.com>
Co-authored-by: Manabu McCloskey <manabu.mccloskey@gmail.com> Signed-off-by: cmoulliard <cmoulliard@redhat.com>
Signed-off-by: cmoulliard <cmoulliard@redhat.com>
Signed-off-by: cmoulliard <cmoulliard@redhat.com>
0cd0d7d to
cdb89b7
Compare
Signed-off-by: cmoulliard <cmoulliard@redhat.com>
nabuskey
left a comment
There was a problem hiding this comment.
Let's merge all files under the types directory. I don't think we should have a file for each struct. It's very Java like right now.😅
pkg/printer/package.go
Outdated
| func generatePackageTable(packagesTable []types.Package) metav1.Table { | ||
| table := &metav1.Table{} | ||
| table.ColumnDefinitions = []metav1.TableColumnDefinition{ | ||
| {Name: "Custom package name", Type: "string"}, |
There was a problem hiding this comment.
I liked "name" more. Custom package is already implied when you run the command.
You mean ArgoCD application URL or git repositories used by ArgoCD applications? |
Indeed but that simplify the readability of the code and Java language rocks from this point of view :-) |
Argocd URL on our IDP to access the application straight from the Argocd UI |
Signed-off-by: cmoulliard <cmoulliard@redhat.com>
Yeah I'd rather keep it uniform within this project. If you look at how we define related types for this project, we do that in a single file like here: https://github.com/cnoe-io/idpbuilder/blob/main/api/v1alpha1/custom_package_types.go So let's merge them into a single file. |
I see, then we should change the name of the column. It's currently named |
Signed-off-by: cmoulliard <cmoulliard@redhat.com>
Signed-off-by: cmoulliard <cmoulliard@redhat.com>
Done: 593b727 |
Signed-off-by: cmoulliard <cmoulliard@redhat.com>
Fixed: da6e72b |
Signed-off-by: cmoulliard <cmoulliard@redhat.com>
…and port Signed-off-by: cmoulliard <cmoulliard@redhat.com>
Signed-off-by: cmoulliard <cmoulliard@redhat.com>
globals/project.go
Outdated
| var ( | ||
| ClusterProtocol string // http or https scheme | ||
| ClusterPort string // 8443 or user's port defined when the cluster is created | ||
| ) | ||
|
|
There was a problem hiding this comment.
Can we get away without using these? How come we can't use GiteaBaseUrl and ArgocdBaseUrl as-is?
There was a problem hiding this comment.
No as we need such global vars to generate the proper URLs of ArgoCD or Gitea. Such variables are collected when the cluster is created. Without such vars it will be needed to fetch them using the kubernetes CR.
k get localbuilds.idpbuilder.cnoe.io/dummy -oyaml
apiVersion: idpbuilder.cnoe.io/v1alpha1
kind: Localbuild
metadata:
name: dummy
spec:
buildCustomization:
host: cnoe.localtest.me
ingressHost: cnoe.localtest.me
port: "9443"
protocol: https
selfSignedCert: |
-----BEGIN CERTIFICATE-----
MIIBsDCCA...EVSNlep0EtTdKee
Sg0OoQ==
-----END CERTIFICATE-----
packageConfigs:
argoPackageConfigs:
enabled: true
embeddedArgoApplicationsPackageConfigs:
enabled: true
There was a problem hiding this comment.
I see. Can we not get it from the CR then? If custom packages exist, then the localbuild object must also exist correct?
There was a problem hiding this comment.
Can we not get it from the CR then? If custom packages exist, then the localbuild object must also exist correct?
We can get it using go code doing this "kubectl get cr/localbuilds.idpbuilder.cnoe.io" but this is a bit boiler plate as we got such values when we execute the command "idp create" ....
There was a problem hiding this comment.
It's one call to the API server yea? i think that's fine. In Go, there's a lot of boilerplate like this 😆
Signed-off-by: cmoulliard <cmoulliard@redhat.com>
…LocalBuild Signed-off-by: cmoulliard <cmoulliard@redhat.com>
Signed-off-by: cmoulliard <cmoulliard@redhat.com>
|
/e2e |