forked from opendatahub-io/opendatahub-operator
-
Notifications
You must be signed in to change notification settings - Fork 1
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: enhances FeatureTracker with spec #17
Merged
cam-garrison
merged 16 commits into
maistra:service-mesh-integration
from
cam-garrison:feature-tracker-spec
Jan 12, 2024
Merged
Changes from 12 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
b68188a
initial add tracker spec
cam-garrison d527e05
update tests, update crd
cam-garrison a75c127
add omitempty to origin struct
cam-garrison aa7dd82
undo accidental tag change
cam-garrison b9e0f99
re add empty line
cam-garrison 4ae4406
move pointer operator
cam-garrison 622d556
add testing
cam-garrison c2f7b71
lint
cam-garrison 1e87b53
re-lint changes
cam-garrison 103593f
add ownertype, move newOrigin() to shared util
cam-garrison 387b013
Update apis/features/v1/features_types.go
cam-garrison 0571826
remove origin from featureinitializer
cam-garrison b10d36f
modify kserve sm step to match dashboard's
cam-garrison b6c18cc
make dsci servicemesh setup like dashboard's
cam-garrison f632227
Merge branch 'service-mesh-integration' into feature-tracker-spec
cam-garrison 3207250
fix merge issues, lint
cam-garrison File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,16 +7,17 @@ import ( | |
corev1 "k8s.io/api/core/v1" | ||
|
||
dsciv1 "github.com/opendatahub-io/opendatahub-operator/v2/apis/dscinitialization/v1" | ||
featurev1 "github.com/opendatahub-io/opendatahub-operator/v2/apis/features/v1" | ||
"github.com/opendatahub-io/opendatahub-operator/v2/pkg/deploy" | ||
"github.com/opendatahub-io/opendatahub-operator/v2/pkg/feature" | ||
"github.com/opendatahub-io/opendatahub-operator/v2/pkg/feature/servicemesh" | ||
) | ||
|
||
func defineServiceMeshFeatures(f *feature.FeaturesInitializer) error { | ||
func defineServiceMeshFeatures(f *feature.FeaturesInitializer, origin featurev1.Origin) error { | ||
serviceMeshSpec := f.ServiceMesh | ||
|
||
smcpCreation, errSmcp := feature.CreateFeature("service-mesh-control-plane-creation"). | ||
For(f.DSCInitializationSpec). | ||
For(f.DSCInitializationSpec, origin). | ||
Manifests( | ||
path.Join(feature.ControlPlaneDir, "base", "control-plane.tmpl"), | ||
). | ||
|
@@ -35,7 +36,7 @@ func defineServiceMeshFeatures(f *feature.FeaturesInitializer) error { | |
|
||
if serviceMeshSpec.ControlPlane.MetricsCollection == "Istio" { | ||
metricsCollection, errMetrics := feature.CreateFeature("service-mesh-monitoring"). | ||
For(f.DSCInitializationSpec). | ||
For(f.DSCInitializationSpec, origin). | ||
Manifests( | ||
path.Join(feature.MonitoringDir), | ||
). | ||
|
@@ -51,7 +52,7 @@ func defineServiceMeshFeatures(f *feature.FeaturesInitializer) error { | |
} | ||
|
||
if oauth, err := feature.CreateFeature("service-mesh-control-plane-configure-oauth"). | ||
For(f.DSCInitializationSpec). | ||
For(f.DSCInitializationSpec, origin). | ||
Manifests( | ||
path.Join(feature.ControlPlaneDir, "base"), | ||
path.Join(feature.ControlPlaneDir, "oauth"), | ||
|
@@ -79,7 +80,7 @@ func defineServiceMeshFeatures(f *feature.FeaturesInitializer) error { | |
} | ||
|
||
if cfMaps, err := feature.CreateFeature("shared-config-maps"). | ||
For(f.DSCInitializationSpec). | ||
For(f.DSCInitializationSpec, origin). | ||
WithResources(servicemesh.ConfigMaps). | ||
Load(); err != nil { | ||
return err | ||
|
@@ -88,7 +89,7 @@ func defineServiceMeshFeatures(f *feature.FeaturesInitializer) error { | |
} | ||
|
||
if serviceMesh, err := feature.CreateFeature("app-add-namespace-to-service-mesh"). | ||
For(f.DSCInitializationSpec). | ||
For(f.DSCInitializationSpec, origin). | ||
Manifests( | ||
path.Join(feature.ControlPlaneDir, "smm.tmpl"), | ||
path.Join(feature.ControlPlaneDir, "namespace.patch.tmpl"), | ||
|
@@ -101,7 +102,7 @@ func defineServiceMeshFeatures(f *feature.FeaturesInitializer) error { | |
} | ||
|
||
if gatewayRoute, err := feature.CreateFeature("service-mesh-create-gateway-route"). | ||
For(f.DSCInitializationSpec). | ||
For(f.DSCInitializationSpec, origin). | ||
Manifests( | ||
path.Join(feature.ControlPlaneDir, "routing"), | ||
). | ||
|
@@ -116,7 +117,7 @@ func defineServiceMeshFeatures(f *feature.FeaturesInitializer) error { | |
} | ||
|
||
if dataScienceProjects, err := feature.CreateFeature("app-migrate-data-science-projects"). | ||
For(f.DSCInitializationSpec). | ||
For(f.DSCInitializationSpec, origin). | ||
WithResources(servicemesh.MigratedDataScienceProjects). | ||
Load(); err != nil { | ||
return err | ||
|
@@ -125,7 +126,7 @@ func defineServiceMeshFeatures(f *feature.FeaturesInitializer) error { | |
} | ||
|
||
if extAuthz, err := feature.CreateFeature("service-mesh-control-plane-setup-external-authorization"). | ||
For(f.DSCInitializationSpec). | ||
For(f.DSCInitializationSpec, origin). | ||
Manifests( | ||
path.Join(feature.AuthDir, "auth-smm.tmpl"), | ||
path.Join(feature.AuthDir, "base"), | ||
|
@@ -168,7 +169,15 @@ func (r *DSCInitializationReconciler) configureServiceMesh(instance *dsciv1.DSCI | |
|
||
switch instance.Spec.ServiceMesh.ManagementState { | ||
case operatorv1.Managed: | ||
serviceMeshInitializer := feature.NewFeaturesInitializer(&instance.Spec, defineServiceMeshFeatures) | ||
origin := featurev1.Origin{ | ||
Type: featurev1.DSCIType, | ||
Name: instance.Name, | ||
} | ||
defineServiceMesh := func(s *feature.FeaturesInitializer) error { | ||
return defineServiceMeshFeatures(s, origin) | ||
} | ||
|
||
serviceMeshInitializer := feature.NewFeaturesInitializer(&instance.Spec, defineServiceMesh) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as for |
||
if err := serviceMeshInitializer.Prepare(); err != nil { | ||
r.Log.Error(err, "failed configuring service mesh resources") | ||
r.Recorder.Eventf(instance, corev1.EventTypeWarning, "DSCInitializationReconcileError", "failed configuring service mesh resources") | ||
|
@@ -195,8 +204,15 @@ func (r *DSCInitializationReconciler) configureServiceMesh(instance *dsciv1.DSCI | |
func (r *DSCInitializationReconciler) removeServiceMesh(instance *dsciv1.DSCInitialization) error { | ||
// on condition of Managed, do not handle Removed when set to Removed it tigger DSCI reconcile to cleanup | ||
if instance.Spec.ServiceMesh.ManagementState == operatorv1.Managed { | ||
serviceMeshInitializer := feature.NewFeaturesInitializer(&instance.Spec, defineServiceMeshFeatures) | ||
origin := featurev1.Origin{ | ||
Type: featurev1.DSCIType, | ||
Name: instance.Name, | ||
} | ||
defineServiceMesh := func(s *feature.FeaturesInitializer) error { | ||
return defineServiceMeshFeatures(s, origin) | ||
} | ||
|
||
serviceMeshInitializer := feature.NewFeaturesInitializer(&instance.Spec, defineServiceMesh) | ||
if err := serviceMeshInitializer.Prepare(); err != nil { | ||
r.Log.Error(err, "failed configuring service mesh resources") | ||
r.Recorder.Eventf(instance, corev1.EventTypeWarning, "DSCInitializationReconcileError", "failed configuring service mesh resources") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about aligning it to how it's done in
dashboard.go
?That would mean:
and chaging
configureServerlessFeatures
to: