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

wip: Rename configmap for sail #392

Closed

Conversation

adam-cattermole
Copy link
Member

@adam-cattermole adam-cattermole commented Jan 3, 2024

Test to see if this fixes sail integration tests until we can pin version.

I don't like the solution will look at refactoring.

@adam-cattermole adam-cattermole self-assigned this Jan 3, 2024
Copy link

codecov bot commented Jan 3, 2024

Codecov Report

Merging #392 (c1ab8d1) into main (f3a0b66) will decrease coverage by 0.01%.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #392      +/-   ##
==========================================
- Coverage   65.87%   65.87%   -0.01%     
==========================================
  Files          35       35              
  Lines        3795     3792       -3     
==========================================
- Hits         2500     2498       -2     
  Misses       1112     1112              
+ Partials      183      182       -1     
Flag Coverage Δ
unit 58.90% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
api/v1beta1 (u) ∅ <ø> (∅)
pkg/common (u) 76.92% <ø> (ø)
pkg/istio (u) 37.11% <ø> (ø)
pkg/log (u) 31.81% <ø> (ø)
pkg/reconcilers (u) 33.21% <ø> (ø)
pkg/rlptools (u) 56.46% <ø> (ø)
controllers (i) 71.97% <ø> (+<0.01%) ⬆️
Files Coverage Δ
controllers/kuadrant_controller.go 51.80% <ø> (-0.13%) ⬇️

@@ -380,7 +383,10 @@ func controlPlaneProviderName() string {
return env.GetString("ISTIOOPERATOR_NAME", "istiocontrolplane")
}

func controlPlaneConfigMapName() string {
func controlPlaneConfigMapName(isSail bool) string {
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this function doesn't belong to pkg/istio/mesh_config.go. It looks like the name of the ConfigMap is an implementation detail of each kind of Istio operator.

If this is indeed the direction we want to go, WDYT about something like the following?

func (r *KuadrantReconciler) getIstioConfigObjects(ctx context.Context, logger logr.Logger) ([]common.ConfigWrapper, error) {
	// ...
	if err == nil || apierrors.IsNotFound(err) {
		opw := istio.NewOperatorWrapper(iop)
		configMapName = opw.ConfigMapName()
		configsToUpdate = append(configsToUpdate, opw)
	} else if !apimeta.IsNoMatchError(err) {
		// ...
	} else {
		// ...
		opw := istio.NewSailWrapper(ist)
		configMapName = opw.ConfigMapName()
		configsToUpdate = append(configsToUpdate, opw)
	}
	// ...
}

Of course, OperatorWrapper and SailWrapper structs would implement ConfigMapName() string as well (apart from ConfigWrapper).

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep that's along the lines of what I was thinking. Unfortunately these changes aren't enough though to solve the install issue, still investigating.

@adam-cattermole
Copy link
Member Author

adam-cattermole commented Jan 8, 2024

I'm going to close this in favour of #391 - the istio CR must be named default, which results in the configmap being named istio which is our normal case. If the istio CR name can be configured down the line then we will need to handle this case where the configmap is named istio-<istio-cr-name>

@adam-cattermole adam-cattermole deleted the fix-sail-install branch January 9, 2024 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants