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

tool to generate a helm chart from an ACM MCE release #709

Merged
merged 7 commits into from
Oct 15, 2024
Merged

Conversation

geoberle
Copy link
Collaborator

What this PR does

extracts and templateizes the manifests from an MCE OLM release bundle

https://issues.redhat.com/browse/ARO-10315

this is part 1 or 2 - this part introduces the base repackage tool
part 2 will use it to replace the current ACM installation (with OLM) to one with helm (without OLM)

Jira:
Link to demo recording:

Special notes for your reviewer

extracts and templateizes the manifests from an MCE OLM release bundle

https://issues.redhat.com/browse/ARO-10315

Signed-off-by: Gerd Oberlechner <[email protected]>
Copy link
Collaborator

@janboll janboll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add tests, many of these files mutate or operator on internal data structures, which should be tested from the beginning on.

tooling/mcerepkg/internal/rukpak/util/util.go Outdated Show resolved Hide resolved
tooling/mcerepkg/main.go Show resolved Hide resolved
Signed-off-by: Gerd Oberlechner <[email protected]>
Signed-off-by: Gerd Oberlechner <[email protected]>
Signed-off-by: Gerd Oberlechner <[email protected]>
Signed-off-by: Gerd Oberlechner <[email protected]>
@geoberle
Copy link
Collaborator Author

Please add tests, many of these files mutate or operator on internal data structures, which should be tested from the beginning on.

i've added some basic tests revolving around the structure of the expected YAMLs.
i've also added some sanity checks that are run before helm chart generation starts.

// load OLM bundle manifests
img, err := crane.Load(mceOlmBundle)
if err != nil {
return err
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please wrap error to make debugging easier

tooling/mcerepkg/main.go Outdated Show resolved Hide resolved
tooling/mcerepkg/main.go Outdated Show resolved Hide resolved
tooling/mcerepkg/main.go Outdated Show resolved Hide resolved
tooling/mcerepkg/main.go Outdated Show resolved Hide resolved
imageRegistryParamName = "imageRegistry"
)

type Customizer func(unstructured.Unstructured) (unstructured.Unstructured, map[string]string, error)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this type enforced from outside? Why is it not using pointers? Could save some memory using i.e.:

type Customizer func(*unstructured.Unstructured) (map[string]string, error)

and update the object in the method

tooling/mcerepkg/internal/customize/scaffold.go Outdated Show resolved Hide resolved
Signed-off-by: Gerd Oberlechner <[email protected]>
@geoberle geoberle merged commit d818c68 into main Oct 15, 2024
24 checks passed
@geoberle geoberle deleted the mcepkg branch October 15, 2024 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants