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

feat: embed templates into operator plugin #5

Merged
merged 19 commits into from
Jul 31, 2023

Conversation

cam-garrison
Copy link

@cam-garrison cam-garrison commented Jul 24, 2023

This PR essentially moves the Service Mesh/Authorization specific resource files that were previously found in our manifests fork in the /service-mesh/ folder into the operator's code base.

  • uses embed functionality in golang
  • since embed creates a read only FS, we use /tmp/ossm-installer/ns/kfdef-name/templates/... to create our finalized template yaml files

To test:
quay.io/maistra-dev/opendatahub-operator:v0.0.5-embed

@cam-garrison cam-garrison marked this pull request as ready for review July 25, 2023 16:18
Copy link

@bartoszmajsak bartoszmajsak left a comment

Choose a reason for hiding this comment

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

Great to see it was possible without a lot of changes. I think we should make clear separation between loading files (in this case to a special tmp folder) and processing templates. For details see my comments below.

pkg/kfapp/ossm/ossm_manifests.go Outdated Show resolved Hide resolved
pkg/kfapp/ossm/ossm_manifests.go Outdated Show resolved Hide resolved
pkg/kfapp/ossm/ossm_manifests.go Outdated Show resolved Hide resolved
pkg/kfapp/ossm/types.go Outdated Show resolved Hide resolved
pkg/kfapp/ossm/ossm_manifests.go Outdated Show resolved Hide resolved
pkg/kfapp/ossm/types.go Outdated Show resolved Hide resolved
pkg/kfapp/ossm/ossm_manifests.go Outdated Show resolved Hide resolved
pkg/kfapp/ossm/ossm_manifests.go Outdated Show resolved Hide resolved
Copy link

@bartoszmajsak bartoszmajsak left a comment

Choose a reason for hiding this comment

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

Hopefully the last round :)

Comment on lines 62 to 65
const (
ControlPlaneDir = "templates/control-plane"
AuthDir = "templates/authorino"
)

Choose a reason for hiding this comment

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

I would move them next to //go:embed, otherwise they're local per func invocation.

Copy link
Author

Choose a reason for hiding this comment

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

moved it with the const baseOutputDir in types.go 22c5bd0

pkg/kfapp/ossm/types.go Outdated Show resolved Hide resolved
pkg/kfapp/ossm/ossm_manifests.go Outdated Show resolved Hide resolved
pkg/kfapp/ossm/ossm_manifests.go Outdated Show resolved Hide resolved
Copy link

@bartoszmajsak bartoszmajsak 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! Just a couple of nits :)

pkg/kfapp/ossm/ossm_manifests.go Outdated Show resolved Hide resolved
pkg/kfapp/ossm/types.go Outdated Show resolved Hide resolved
pkg/kfapp/ossm/types.go Outdated Show resolved Hide resolved
pkg/kfapp/ossm/types.go Outdated Show resolved Hide resolved
pkg/kfapp/ossm/types.go Show resolved Hide resolved
cam-garrison and others added 5 commits July 31, 2023 14:21
@cam-garrison cam-garrison merged commit 3b4a089 into kf_ossm_plugin Jul 31, 2023
bartoszmajsak added a commit that referenced this pull request Sep 6, 2023
embed templates to OSSM plugin

Co-authored-by: Bartosz Majsak <[email protected]>
bartoszmajsak added a commit that referenced this pull request Sep 6, 2023
embed templates to OSSM plugin

Co-authored-by: Bartosz Majsak <[email protected]>
@bartoszmajsak bartoszmajsak deleted the embed-templates branch October 4, 2023 04:45
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