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

Disable logger development mode to avoid panicking, use zap as logger #114

Merged
merged 9 commits into from
Sep 10, 2024

Conversation

njuettner
Copy link
Member

@njuettner njuettner commented Sep 10, 2024

Unfortunately I had to make all the changes for one small change, the build was already failing before.

Towards: giantswarm/roadmap#3658

@njuettner njuettner requested a review from a team as a code owner September 10, 2024 09:47
Scheme: scheme,
MetricsBindAddress: metricsAddr,
Port: 9443,
Scheme: scheme,
Copy link
Member Author

Choose a reason for hiding this comment

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

I did my best to make azure-private-endpoint-operator working again. when I changed zap Development flag it was not even building due to a lot of changes in controller-manager

@@ -76,7 +77,7 @@ func (s *Service) ReconcileMcToWcApi(ctx context.Context) error {
//
for _, privateLink := range privateLinks {
logger.Info(fmt.Sprintf("Found private link %s", privateLink.Name))
manualApproval := !slice.Contains(privateLink.AutoApprovedSubscriptions, s.privateEndpointsScope.GetSubscriptionID())
manualApproval := !slice.Contains(util.ConvertToStringSlice(privateLink.AutoApprovedSubscriptions), s.privateEndpointsScope.GetSubscriptionID())
Copy link
Member Author

Choose a reason for hiding this comment

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

I had to add a helper function converting privateLinks, because I had to update github.com/giantswarm/cluster-api-provider-azure

There's no native function included, that's why I had to come up with something

Copy link
Member Author

Choose a reason for hiding this comment

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

private links are in github.com/giantswarm/cluster-api-provider-azure v1.12.4 pointer string slices

@@ -64,11 +64,10 @@ func (s *Scope) LookupPrivateLink(privateLinkResourceID string) (capz.PrivateLin
func (s *Scope) GetPrivateLinksWithAllowedSubscription(managementClusterSubscriptionID string) []capz.PrivateLink {
var privateLinksWhereMCSubscriptionIsAllowed []capz.PrivateLink
for _, privateLink := range s.privateLinks {
if slice.Contains(privateLink.AllowedSubscriptions, managementClusterSubscriptionID) {
if util.ContainsPtr(privateLink.AllowedSubscriptions, managementClusterSubscriptionID) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Same here, slice.Contains in azure-private-endpoint-operator but not Contains for Pointer

@@ -6,8 +6,8 @@ import (

type PrivateLinkBuilder struct {
name string
allowedSubscriptions []string
autoApprovedSubscriptions []string
allowedSubscriptions []*string
Copy link
Member Author

Choose a reason for hiding this comment

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

This also needed to chang.

@njuettner njuettner requested a review from a team as a code owner September 10, 2024 11:07
@njuettner njuettner requested a review from a team September 10, 2024 11:19
@njuettner njuettner merged commit 5dbdc00 into main Sep 10, 2024
6 checks passed
@njuettner njuettner deleted the fix-zapper branch September 10, 2024 12:31
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.

3 participants