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

fix: upgrade golang.org/x/text to fix the vulnerability #138

Merged
merged 8 commits into from
Oct 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ require (
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/text v0.4.0 // indirect
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
Expand Down
3 changes: 2 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -686,8 +686,9 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
Expand Down
110 changes: 55 additions & 55 deletions pkg/controllers/member/serviceexport/controller_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,12 @@ var _ = Describe("serviceexport controller", func() {
AfterEach(func() {
Expect(memberClient.Delete(ctx, svcExport)).Should(Succeed())
// Confirm that ServiceExport has been deleted; this helps make the test less flaky.
Eventually(serviceExportIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceExportIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
})

It("should mark the service export as invalid + should not export service", func() {
Eventually(serviceIsInvalidForExportNotFoundActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Consistently(serviceIsNotExportedActual, consistentlyDuration, consistentlyInterval).Should(BeNil())
Eventually(serviceIsInvalidForExportNotFoundActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
Consistently(serviceIsNotExportedActual, consistentlyDuration, consistentlyInterval).Should(Succeed())
})
})

Expand All @@ -314,15 +314,15 @@ var _ = Describe("serviceexport controller", func() {
Expect(memberClient.Delete(ctx, svc)).Should(Succeed())

// Confirm that the Service has been unexported; this helps make the tests less flaky.
Eventually(serviceIsNotExportedActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsNotExportedActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())

Eventually(serviceExportIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceExportIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
Eventually(serviceIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
})

It("should mark the service export as valid + should export the service", func() {
Eventually(serviceIsExportedFromMemberActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsExportedToHubActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsExportedFromMemberActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
Eventually(serviceIsExportedToHubActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
})
})

Expand All @@ -343,15 +343,15 @@ var _ = Describe("serviceexport controller", func() {
Expect(memberClient.Delete(ctx, svc)).Should(Succeed())

// Confirm that the Service has been unexported; this helps make the tests less flaky.
Eventually(serviceIsNotExportedActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsNotExportedActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())

Eventually(serviceExportIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceExportIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
Eventually(serviceIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
})

It("should mark the service export as valid + should export the service", func() {
Eventually(serviceIsExportedFromMemberActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsExportedToHubActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsExportedFromMemberActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
Eventually(serviceIsExportedToHubActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
})
})

Expand All @@ -375,16 +375,16 @@ var _ = Describe("serviceexport controller", func() {
Expect(memberClient.Delete(ctx, svc)).Should(Succeed())

// Confirm that the Service has been unexported; this helps make the tests less flaky.
Eventually(serviceIsNotExportedActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsNotExportedActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())

Eventually(serviceExportIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceExportIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
Eventually(serviceIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
})

It("should update the exported service", func() {
By("confirm that the service has been exported")
Eventually(serviceIsExportedFromMemberActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsExportedToHubActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsExportedFromMemberActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
Eventually(serviceIsExportedToHubActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())

By("update the service")
Expect(memberClient.Get(ctx, svcOrSvcExportKey, svc)).Should(Succeed())
Expand Down Expand Up @@ -439,7 +439,7 @@ var _ = Describe("serviceexport controller", func() {
return fmt.Errorf("internalServiceExport spec (-got, +want): %s", diff)
}
return nil
}, eventuallyTimeout, eventuallyInterval).Should(BeNil())
}, eventuallyTimeout, eventuallyInterval).Should(Succeed())
})
})

Expand All @@ -458,19 +458,19 @@ var _ = Describe("serviceexport controller", func() {
AfterEach(func() {
Expect(memberClient.Delete(ctx, svc)).Should(Succeed())
// Confirm that Service has been deleted; this helps make the test less flaky.
Eventually(serviceIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
})

It("should unexport the service when service export is deleted", func() {
By("confirm that the service has been exported")
Eventually(serviceIsExportedFromMemberActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsExportedToHubActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsExportedFromMemberActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
Eventually(serviceIsExportedToHubActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())

By("delete the service export")
Expect(memberClient.Delete(ctx, svcExport)).Should(Succeed())

By("confirm that the service has been unexported")
Eventually(serviceIsNotExportedActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsNotExportedActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
})
})

Expand All @@ -489,21 +489,21 @@ var _ = Describe("serviceexport controller", func() {
AfterEach(func() {
Expect(memberClient.Delete(ctx, svcExport)).Should(Succeed())
// Confirm that the ServiceExport has been deleted; this helps make the test less flaky.
Eventually(serviceExportIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceExportIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
})

It("should unexport the service when service is deleted", func() {
By("confirm that the service has been exported")
Eventually(serviceIsExportedFromMemberActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsExportedToHubActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsExportedFromMemberActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
Eventually(serviceIsExportedToHubActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())

By("delete the service")
Expect(memberClient.Delete(ctx, svc)).Should(Succeed())
Eventually(serviceIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())

By("confirm that the service has been unexported")
Eventually(serviceIsNotExportedActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsInvalidForExportNotFoundActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsNotExportedActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
Eventually(serviceIsInvalidForExportNotFoundActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
})
})

Expand All @@ -524,13 +524,13 @@ var _ = Describe("serviceexport controller", func() {
Expect(memberClient.Delete(ctx, svc)).Should(Succeed())

// Confirm that Service + ServiceExport have been deleted; this helps make the test less flaky.
Eventually(serviceExportIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceExportIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
Eventually(serviceIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
})

It("should mark the service export as invalid (ineligible) + should not export headless service", func() {
Eventually(serviceIsInvalidForExportIneligibleActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Consistently(serviceIsNotExportedActual, consistentlyDuration, consistentlyInterval).Should(BeNil())
Eventually(serviceIsInvalidForExportIneligibleActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
Consistently(serviceIsNotExportedActual, consistentlyDuration, consistentlyInterval).Should(Succeed())
})
})

Expand All @@ -551,13 +551,13 @@ var _ = Describe("serviceexport controller", func() {
Expect(memberClient.Delete(ctx, svc)).Should(Succeed())

// Confirm that Service + ServiceExport have been deleted; this helps make the test less flaky.
Eventually(serviceExportIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceExportIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
Eventually(serviceIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
})

It("should mark the service export as invalid (ineligible) + should not export external name service", func() {
Eventually(serviceIsInvalidForExportIneligibleActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Consistently(serviceIsNotExportedActual, consistentlyDuration, consistentlyInterval).Should(BeNil())
Eventually(serviceIsInvalidForExportIneligibleActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
Consistently(serviceIsNotExportedActual, consistentlyDuration, consistentlyInterval).Should(Succeed())
})
})

Expand All @@ -578,14 +578,14 @@ var _ = Describe("serviceexport controller", func() {
Expect(memberClient.Delete(ctx, svc)).Should(Succeed())

// Confirm that Service + ServiceExport have been deleted; this helps make the test less flaky.
Eventually(serviceExportIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceExportIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
Eventually(serviceIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
})

It("should mark the service export as invalid (ineligible) + should unexport the service", func() {
By("confirm that the service has been exported")
Eventually(serviceIsExportedFromMemberActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsExportedToHubActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsExportedFromMemberActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
Eventually(serviceIsExportedToHubActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())

By("update the service; set it to an external name service")
Expect(memberClient.Get(ctx, svcOrSvcExportKey, svc)).Should(Succeed())
Expand All @@ -595,8 +595,8 @@ var _ = Describe("serviceexport controller", func() {
Expect(memberClient.Update(ctx, svc)).Should(Succeed())

By("confirm that the service has been unexported")
Eventually(serviceIsNotExportedActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsInvalidForExportIneligibleActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsNotExportedActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
Eventually(serviceIsInvalidForExportIneligibleActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
})
})

Expand All @@ -617,17 +617,17 @@ var _ = Describe("serviceexport controller", func() {
Expect(memberClient.Delete(ctx, svc)).Should(Succeed())

// Confirm that the Service has been unexported; this helps make the tests less flaky.
Eventually(serviceIsNotExportedActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsNotExportedActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())

// Confirm that Service + ServiceExport have been deleted; this helps make the test less flaky.
Eventually(serviceExportIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceExportIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
Eventually(serviceIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
})

It("should mark the service export as valid + should export the service", func() {
By("confirm that the service has not been exported")
Consistently(serviceIsNotExportedActual, consistentlyDuration, consistentlyInterval).Should(BeNil())
Eventually(serviceIsInvalidForExportIneligibleActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Consistently(serviceIsNotExportedActual, consistentlyDuration, consistentlyInterval).Should(Succeed())
Eventually(serviceIsInvalidForExportIneligibleActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())

By("update the service; set it as a cluster IP service")
Expect(memberClient.Get(ctx, svcOrSvcExportKey, svc)).Should(Succeed())
Expand All @@ -642,8 +642,8 @@ var _ = Describe("serviceexport controller", func() {
Expect(memberClient.Update(ctx, svc)).Should(Succeed())

By("confirm that the service has been exported")
Eventually(serviceIsExportedFromMemberActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsExportedToHubActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsExportedFromMemberActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
Eventually(serviceIsExportedToHubActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
})
})

Expand Down Expand Up @@ -695,18 +695,18 @@ var _ = Describe("serviceexport controller", func() {
Expect(memberClient.Delete(ctx, svc)).Should(Succeed())

// Confirm that the Service has been unexported; this helps make the tests less flaky.
Eventually(serviceIsNotExportedActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsNotExportedActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())

// Confirm that Service + ServiceExport have been deleted; this helps make the test less flaky.
Eventually(serviceExportIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceExportIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
Eventually(serviceIsAbsentActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
})

It("should re-export the service", func() {
// Confirm that the Service has been exported.
Eventually(serviceIsExportedFromMemberActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsExportedFromMemberActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
// Confirm that the InternalServiceExport has been re-created.
Eventually(serviceIsExportedToHubActual, eventuallyTimeout, eventuallyInterval).Should(BeNil())
Eventually(serviceIsExportedToHubActual, eventuallyTimeout, eventuallyInterval).Should(Succeed())
})
})
})
5 changes: 3 additions & 2 deletions test/e2e/framework/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ const (
// PollInterval defines the interval time for a poll operation.
PollInterval = 1 * time.Second
// PollTimeout defines the time after which the poll operation times out.
PollTimeout = 20 * time.Second
// Increase the poll timeout to capture the service export condition changes.
PollTimeout = 60 * time.Second

// MCSLBPollTimeout defines the time to wait a MCS to be assigned with LoadBalancer IP address.
// As MCS depending on handling service related to cloud provider, more time is required.
MCSLBPollTimeout = 180 * time.Second
MCSLBPollTimeout = 240 * time.Second

// TestNamespacePrefix defines the prefix of test namespaces.
TestNamespacePrefix = "my-ns"
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/framework/workload_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,10 @@ func (wm *WorkloadManager) UnexportService(ctx context.Context, svcExport fleetn
return nil
}

// defaultBackOff return an exponential backoff which will add up to about 25 seconds.
// defaultBackOff return an exponential backoff.
func defaultBackOff() wait.Backoff {
backoff := wait.Backoff{
Steps: 8,
Steps: 20,
Duration: 1 * time.Second,
Factor: 1.4,
Jitter: 0.1,
Expand Down