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

add 'ksctl generate nstemplatetiers' command #31

Merged
merged 5 commits into from
Apr 23, 2024

Conversation

MatousJobanek
Copy link
Contributor

@MatousJobanek MatousJobanek commented Apr 17, 2024

based on the changes in host-operator repo and toolchain-common - see codeready-toolchain/toolchain-common#381

this PR adds a new command ksctl generate nstemplatetiers that takes a folder with tier templates (in the same format as we have in host-operator here: https://github.com/codeready-toolchain/host-operator/tree/master/deploy/templates/nstemplatetiers) and generates resulting TierTemplates and NSTemplateTiers in the out directory together with kustomization.yaml files.
In this way, Konflux team can move the definition of their tiers out of host-operator and manage them in infra-deployments via ArgoCD.

KUBESAW-60

For testing purposes, I copied the content of the appstudio tiers into test-resources folder

Copy link
Contributor

@mfrancisc mfrancisc left a comment

Choose a reason for hiding this comment

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

Great Job 👍

I have only one minor question - is it intentional that the command creates also the source directory or should we just create the out-dir specified in the parameter?

I see that for example in this command:

/ksctl generate nstemplatetiers --source /Users/fmuntean/go/src/github.com/codeready-toolchain/host-operator/deploy/templates/nstemplatetiers/base --out-dir /tmp/basetemplates

the base folder is created in the output dir, even if not specifically required, but I guess it's fine.

Storing TierTemplate with name base-dev-1823953810-1823953810 in /tmp/basetemplates/base/tiertemplate-base-dev-1823953810-1823953810.yaml

@MatousJobanek
Copy link
Contributor Author

@mfrancisc
Good question - the command groups the manifests in folders by tier name and it doesn't care if it's one tier or more of them. For the simplicity, I would keep it as it is.

Copy link

codecov bot commented Apr 22, 2024

Codecov Report

Merging #31 (d1ecc69) into master (cfee5c4) will decrease coverage by 0.16%.
The diff coverage is 62.35%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #31      +/-   ##
==========================================
- Coverage   65.72%   65.57%   -0.16%     
==========================================
  Files          40       41       +1     
  Lines        2028     2100      +72     
==========================================
+ Hits         1333     1377      +44     
- Misses        537      560      +23     
- Partials      158      163       +5     
Files Coverage Δ
pkg/cmd/generate/generate.go 0.00% <0.00%> (ø)
pkg/cmd/generate/util.go 77.03% <78.57%> (+1.20%) ⬆️
pkg/cmd/generate/nstemplatetiers.go 55.35% <55.35%> (ø)

@MatousJobanek MatousJobanek merged commit 0c82465 into kubesaw:master Apr 23, 2024
7 of 8 checks passed
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.

4 participants