From 925c097d9b85586974925ae55320f20cae895e58 Mon Sep 17 00:00:00 2001 From: Nadezhda Savchenko Date: Mon, 18 Mar 2024 11:40:44 +0300 Subject: [PATCH 1/6] Run all tests on single YTsaurus cluster --- app_test.go | 435 +++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 309 insertions(+), 126 deletions(-) diff --git a/app_test.go b/app_test.go index 704a714..40a8942 100644 --- a/app_test.go +++ b/app_test.go @@ -2,7 +2,13 @@ package main import ( "context" + "fmt" + "github.com/stretchr/testify/suite" + "go.ytsaurus.tech/yt/go/ypath" + "k8s.io/utils/clock" + "log" "os" + "slices" "testing" "time" @@ -232,40 +238,6 @@ var ( // we test several things in each test case, because of long wait for local ytsaurus // container start. testCases = []testCase{ - { - name: "a-skip-b-create-c-remove", - azureUsersSetUp: []SourceUser{ - aliceAzure, - bobAzure, - }, - ytUsersSetUp: []YtsaurusUser{ - aliceYtsaurus, - carolYtsaurus, - }, - ytUsersExpected: []YtsaurusUser{ - aliceYtsaurus, - bobYtsaurus, - }, - }, - { - name: "bob-is-banned", - appConfig: &AppConfig{ - UsernameReplacements: defaultUsernameReplacements, - GroupnameReplacements: defaultGroupnameReplacements, - BanBeforeRemoveDuration: 24 * time.Hour, - }, - ytUsersSetUp: []YtsaurusUser{ - aliceYtsaurus, - bobYtsaurus, - }, - azureUsersSetUp: []SourceUser{ - aliceAzure, - }, - ytUsersExpected: []YtsaurusUser{ - aliceYtsaurus, - bobYtsaurusBanned, - }, - }, { name: "bob-was-banned-now-deleted-carol-was-banned-now-back", // Bob was banned at initialTestTime, @@ -512,6 +484,276 @@ var ( } ) +type AppTestSuite struct { + suite.Suite + ytsaurusLocal *YtsaurusLocal + ytsaurusClient yt.Client + initialYtsaurusUsers []YtsaurusUser + initialYtsaurusGroups []YtsaurusGroupWithMembers + initialYtsaurusUsernames []string + initialYtsaurusGroupnames []string + ctx context.Context +} + +func (suite *AppTestSuite) SetupSuite() { + suite.ctx = context.Background() + suite.ytsaurusLocal = NewYtsaurusLocal() + + if err := suite.ytsaurusLocal.Start(); err != nil { + log.Fatalf("error starting ytsaurus local container: %s", err) + } + + ytsaurusClient, err := suite.ytsaurusLocal.GetClient() + if err != nil { + log.Fatalf("error creating ytsaurus local client: %s", err) + } + + suite.ytsaurusClient = ytsaurusClient + + err = os.Setenv(defaultYtsaurusSecretEnvVar, ytDevToken) + if err != nil { + log.Fatalf("failed to set YT_TOKEN: %s", err) + } + + suite.initialYtsaurusUsers, suite.initialYtsaurusGroups, err = suite.getAllYtsaurusObjects() + if err != nil { + log.Fatalf("error getting initial ytsaurus objects: %s", err) + } + + for _, user := range suite.initialYtsaurusUsers { + suite.initialYtsaurusUsernames = append(suite.initialYtsaurusUsernames, user.Username) + } + + for _, group := range suite.initialYtsaurusGroups { + suite.initialYtsaurusGroupnames = append(suite.initialYtsaurusGroupnames, group.Name) + } +} + +func (suite *AppTestSuite) TearDownSuite() { + if err := suite.ytsaurusLocal.Stop(); err != nil { + log.Fatalf("error terminating ytsaurus local container: %s", err) + } +} + +func (suite *AppTestSuite) getAllYtsaurusObjects() (users []YtsaurusUser, groups []YtsaurusGroupWithMembers, err error) { + allUsers, err := doGetAllYtsaurusUsers(context.Background(), suite.ytsaurusClient, "azure") + if err != nil { + return nil, nil, err + } + allGroups, err := doGetAllYtsaurusGroupsWithMembers(context.Background(), suite.ytsaurusClient, "azure") + return allUsers, allGroups, nil +} + +func (suite *AppTestSuite) diffYtsaurusObjects(expectedUsers []YtsaurusUser, expectedGroups []YtsaurusGroupWithMembers) (string, string) { + actualUsers, actualGroups, err := suite.getAllYtsaurusObjects() + if err != nil { + log.Fatalf("failed to get all ytsaurus objects: %s", err) + } + allExpectedUsers := append(suite.initialYtsaurusUsers, expectedUsers...) + allExpectedGroups := append(suite.initialYtsaurusGroups, expectedGroups...) + + // It seems that `users` group @members attr contains not the all users in the system: + // for example it doesn't include: + // alien_cell_synchronizer, file_cache, guest, operations_cleaner, operations_client, etc... + // we don't want to test that. + // Though we expect it to include users created in test, so we update group members in out expected group list. + var expectedNewUsernamesInUsersGroup []string + for _, u := range expectedUsers { + expectedNewUsernamesInUsersGroup = append(expectedNewUsernamesInUsersGroup, u.Username) + } + for idx, group := range allExpectedGroups { + if group.Name == "users" { + for _, uname := range expectedNewUsernamesInUsersGroup { + allExpectedGroups[idx].Members.Add(uname) + } + } + } + + uDiff := cmp.Diff( + actualUsers, + allExpectedUsers, + cmpopts.SortSlices(func(left, right YtsaurusUser) bool { + return left.Username < right.Username + }), + ) + gDiff := cmp.Diff( + actualGroups, + allExpectedGroups, + cmpopts.SortSlices(func(left, right YtsaurusGroupWithMembers) bool { + return left.Name < right.Name + }), + ) + + return uDiff, gDiff +} + +func (suite *AppTestSuite) clear() { + users, groups, err := suite.getAllYtsaurusObjects() + if err != nil { + log.Fatalf("failed to get ytsaurus objects: %s", err) + } + + for _, user := range users { + if !slices.Contains(suite.initialYtsaurusUsernames, user.Username) { + path := ypath.Path(fmt.Sprintf("//sys/users/%s", user.Username)) + err := suite.ytsaurusClient.RemoveNode(suite.ctx, path, nil) + if err != nil { + log.Fatalf("failed to remove user: %s", user.Username) + } + + exists := true + for exists { + exists, err = suite.ytsaurusClient.NodeExists(suite.ctx, path, nil) + if err != nil { + log.Fatalf("failed to check is group removed") + } + } + } + } + + for _, group := range groups { + if !slices.Contains(suite.initialYtsaurusGroupnames, group.Name) { + path := ypath.Path(fmt.Sprintf("//sys/groups/%s", group.Name)) + err := suite.ytsaurusClient.RemoveNode(suite.ctx, path, nil) + if err != nil { + log.Fatalf("failed to remove group: %s", group.Name) + } + exists := true + for exists { + exists, err = suite.ytsaurusClient.NodeExists(suite.ctx, path, nil) + if err != nil { + log.Fatalf("failed to check is group removed") + } + } + } + } + +} + +func (suite *AppTestSuite) syncOnce(t *testing.T, source Source, clock clock.PassiveClock, appConfig *AppConfig) { + if appConfig == nil { + appConfig = defaultAppConfig + } + + app, err := NewAppCustomized( + &Config{ + App: *appConfig, + Azure: &AzureConfig{}, + Ytsaurus: YtsaurusConfig{ + Proxy: suite.ytsaurusLocal.GetProxy(), + ApplyUserChanges: true, + ApplyGroupChanges: true, + ApplyMemberChanges: true, + LogLevel: "DEBUG", + SourceAttributeName: "azure", + }, + }, getDevelopmentLogger(), + source, + clock, + ) + require.NoError(t, err) + + app.syncOnce() +} + +func (suite *AppTestSuite) check(t *testing.T, expectedUsers []YtsaurusUser, expectedGroups []YtsaurusGroupWithMembers) { + // we have eventually here, because user removal takes some time. + require.Eventually( + t, + func() bool { + udiff, gdiff := suite.diffYtsaurusObjects(expectedUsers, expectedGroups) + actualUsers, actualGroups, err := suite.getAllYtsaurusObjects() + if err != nil { + log.Fatalf("failed to get all ytsaurus objects: %s", err) + } + if udiff != "" { + t.Log("Users diff is not empty yet:", udiff) + t.Log("expected users", expectedUsers) + t.Log("actual users", actualUsers) + } + if gdiff != "" { + t.Log("Groups diff is not empty yet:", gdiff) + t.Log("expected groups", expectedGroups) + t.Log("actual groups", actualGroups) + } + return udiff == "" && gdiff == "" + }, + 3*time.Second, + 300*time.Millisecond, + ) +} + +func (suite *AppTestSuite) TestSkipCreateRemove() { + defer suite.clear() + + t := suite.T() + passiveClock := testclock.NewFakePassiveClock(initialTestTime) + + azure := NewAzureFake() + azure.setUsers([]SourceUser{ + aliceAzure, + bobAzure, + }) + + setupYtsaurusObjects( + t, + suite.ytsaurusClient, + []YtsaurusUser{ + aliceYtsaurus, + carolYtsaurus, + }, + nil, + ) + + expectedYtsaurusUsers := []YtsaurusUser{ + aliceYtsaurus, + bobYtsaurus, + } + + suite.syncOnce(t, azure, passiveClock, nil) + + suite.check(t, expectedYtsaurusUsers, nil) +} + +func (suite *AppTestSuite) TestUserBanned() { + defer suite.clear() + + t := suite.T() + passiveClock := testclock.NewFakePassiveClock(initialTestTime) + + azure := NewAzureFake() + azure.setUsers([]SourceUser{ + aliceAzure, + }) + + setupYtsaurusObjects( + t, + suite.ytsaurusClient, + []YtsaurusUser{ + aliceYtsaurus, + bobYtsaurus, + }, + nil, + ) + + appConfig := &AppConfig{ + UsernameReplacements: defaultUsernameReplacements, + GroupnameReplacements: defaultGroupnameReplacements, + BanBeforeRemoveDuration: 24 * time.Hour, + } + suite.syncOnce(t, azure, passiveClock, appConfig) + + expectedYtsaurusUsers := []YtsaurusUser{ + aliceYtsaurus, + bobYtsaurusBanned, + } + suite.check(t, expectedYtsaurusUsers, nil) +} + +func TestAppTestSuite(t *testing.T) { + suite.Run(t, new(AppTestSuite)) +} + // TestAppSync uses local YTsaurus container and fake Azure to test all the cases: // [x] If Azure user not in YTsaurus -> created; // [x] If Azure user already in YTsaurus no changes -> skipped; @@ -530,7 +772,7 @@ var ( // [x] If Azure group displayName changed AND Azure members changed -> recreate YTsaurus group with actual members set; // [x] YTsaurus group name is built according to config; // [x] Remove limits config option works. -func TestAppSync(t *testing.T) { +/*func TestAppSync(t *testing.T) { require.NoError(t, os.Setenv(defaultYtsaurusSecretEnvVar, ytDevToken)) for _, tc := range testCases { t.Run( @@ -579,32 +821,11 @@ func TestAppSync(t *testing.T) { app.syncOnce() - // we have eventually here, because user removal takes some time. - require.Eventually( - t, - func() bool { - udiff, gdiff := diffYtsaurusObjects(t, ytClient, tc.ytUsersExpected, initialYtUsers, tc.ytGroupsExpected, initialYtGroups) - actualUsers, actualGroups := getAllYtsaurusObjects(t, ytClient) - if udiff != "" { - t.Log("Users diff is not empty yet:", udiff) - t.Log("expected users", tc.ytUsersExpected) - t.Log("actual users", actualUsers) - } - if gdiff != "" { - t.Log("Groups diff is not empty yet:", gdiff) - t.Log("expected groups", tc.ytGroupsExpected) - t.Log("actual groups", actualGroups) - } - return udiff == "" && gdiff == "" - }, - 3*time.Second, - 300*time.Millisecond, - ) } }(tc), ) } -} +}*/ func TestManageUnmanagedUsersIsForbidden(t *testing.T) { ytLocal := NewYtsaurusLocal() @@ -653,86 +874,48 @@ func TestManageUnmanagedUsersIsForbidden(t *testing.T) { } } -func getAllYtsaurusObjects(t *testing.T, client yt.Client) (users []YtsaurusUser, groups []YtsaurusGroupWithMembers) { - allUsers, err := doGetAllYtsaurusUsers(context.Background(), client, "azure") - require.NoError(t, err) - allGroups, err := doGetAllYtsaurusGroupsWithMembers(context.Background(), client, "azure") - require.NoError(t, err) - return allUsers, allGroups -} - func setupYtsaurusObjects(t *testing.T, client yt.Client, users []YtsaurusUser, groups []YtsaurusGroupWithMembers) { - t.Log("Setting up yt for test") - for _, user := range users { - t.Logf("creating user: %v", user) - err := doCreateYtsaurusUser( - context.Background(), - client, - user.Username, - buildUserAttributes(user, "azure"), - ) - require.NoError(t, err) - } - - for _, group := range groups { - t.Log("creating group:", group) - err := doCreateYtsaurusGroup( - context.Background(), - client, - group.Name, - buildGroupAttributes(group.YtsaurusGroup, "azure"), - ) - require.NoError(t, err) - for member := range group.Members.Iter() { - err = doAddMemberYtsaurusGroup( + t.Log("Setting up ytsaurus for test") + if users != nil { + for _, user := range users { + t.Logf("creating user: %v", user) + + userAttributes := buildUserAttributes(user, "azure") + userAttributes["is_test"] = true + err := doCreateYtsaurusUser( context.Background(), client, - member, - group.Name, + user.Username, + userAttributes, ) + require.NoError(t, err) } - require.NoError(t, err) } -} -func diffYtsaurusObjects(t *testing.T, client yt.Client, expectedUsers, initialUsers []YtsaurusUser, expectedGroups, initalGroups []YtsaurusGroupWithMembers) (string, string) { - actualUsers, actualGroups := getAllYtsaurusObjects(t, client) - allExpectedUsers := append(initialUsers, expectedUsers...) - allExpectedGroups := append(initalGroups, expectedGroups...) + if groups != nil { + for _, group := range groups { + t.Log("creating group:", group) - // It seems that `users` group @members attr contains not the all users in the system: - // for example it doesn't include: - // alien_cell_synchronizer, file_cache, guest, operations_cleaner, operations_client, etc... - // we don't want to test that. - // Though we expect it to include users created in test, so we update group members in out expected group list. - var expectedNewUsernamesInUsersGroup []string - for _, u := range expectedUsers { - expectedNewUsernamesInUsersGroup = append(expectedNewUsernamesInUsersGroup, u.Username) - } - for idx, group := range allExpectedGroups { - if group.Name == "users" { - for _, uname := range expectedNewUsernamesInUsersGroup { - allExpectedGroups[idx].Members.Add(uname) + groupAttributes := buildGroupAttributes(group.YtsaurusGroup, "azure") + groupAttributes["is_test"] = true + err := doCreateYtsaurusGroup( + context.Background(), + client, + group.Name, + groupAttributes, + ) + require.NoError(t, err) + for member := range group.Members.Iter() { + err = doAddMemberYtsaurusGroup( + context.Background(), + client, + member, + group.Name, + ) } + require.NoError(t, err) } } - - uDiff := cmp.Diff( - actualUsers, - allExpectedUsers, - cmpopts.SortSlices(func(left, right YtsaurusUser) bool { - return left.Username < right.Username - }), - ) - gDiff := cmp.Diff( - actualGroups, - allExpectedGroups, - cmpopts.SortSlices(func(left, right YtsaurusGroupWithMembers) bool { - return left.Name < right.Name - }), - ) - - return uDiff, gDiff } func parseAppTime(timStr string) time.Time { From 4799b5cee5840cf8c22fad5414d07118666092db Mon Sep 17 00:00:00 2001 From: Nadezhda Savchenko Date: Mon, 18 Mar 2024 12:10:05 +0300 Subject: [PATCH 2/6] Update go.mod --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index baf7029..cad6dfe 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,6 @@ require ( github.com/stretchr/testify v1.8.4 github.com/testcontainers/testcontainers-go v0.28.0 go.uber.org/zap v1.26.0 - go.ytsaurus.tech/library/go/ptr v0.0.1 go.ytsaurus.tech/yt/go v0.0.13 gopkg.in/yaml.v3 v3.0.1 k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5 @@ -90,6 +89,7 @@ require ( go.ytsaurus.tech/library/go/blockcodecs v0.0.2 // indirect go.ytsaurus.tech/library/go/core/log v0.0.3 // indirect go.ytsaurus.tech/library/go/core/xerrors v0.0.3 // indirect + go.ytsaurus.tech/library/go/ptr v0.0.1 // indirect go.ytsaurus.tech/library/go/x/xreflect v0.0.2 // indirect go.ytsaurus.tech/library/go/x/xruntime v0.0.3 // indirect golang.org/x/crypto v0.17.0 // indirect From 4a782fdb9e7350487875925694646fe506d5525d Mon Sep 17 00:00:00 2001 From: Nadezhda Savchenko Date: Tue, 19 Mar 2024 17:59:32 +0300 Subject: [PATCH 3/6] wip --- .github/workflows/go.yml | 2 +- app_test.go | 274 ++++++++++++++++----------------------- go.mod | 3 +- go.sum | 52 ++++++++ 4 files changed, 169 insertions(+), 162 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 159aad2..1b34c0d 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -25,7 +25,7 @@ jobs: run: go build -v ./... - name: Test - run: go test -v ./... + run: RUN_TESTS_WITH_NEW_YT=yes go test -v ./... - name: Run golangci-lint uses: golangci/golangci-lint-action@v3.7.0 diff --git a/app_test.go b/app_test.go index 40a8942..07a5f5b 100644 --- a/app_test.go +++ b/app_test.go @@ -3,15 +3,16 @@ package main import ( "context" "fmt" - "github.com/stretchr/testify/suite" - "go.ytsaurus.tech/yt/go/ypath" - "k8s.io/utils/clock" "log" "os" "slices" "testing" "time" + "github.com/stretchr/testify/suite" + "go.ytsaurus.tech/yt/go/ypath" + "k8s.io/utils/clock" + "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/stretchr/testify/require" @@ -21,7 +22,8 @@ import ( ) const ( - ytDevToken = "password" + ytDevToken = "password" + runTestsWithNewYtEnvVar = "RUN_TESTS_WITH_NEW_YT" ) type testCase struct { @@ -238,6 +240,40 @@ var ( // we test several things in each test case, because of long wait for local ytsaurus // container start. testCases = []testCase{ + { + name: "a-skip-b-create-c-remove", + azureUsersSetUp: []SourceUser{ + aliceAzure, + bobAzure, + }, + ytUsersSetUp: []YtsaurusUser{ + aliceYtsaurus, + carolYtsaurus, + }, + ytUsersExpected: []YtsaurusUser{ + aliceYtsaurus, + bobYtsaurus, + }, + }, + { + name: "bob-is-banned", + appConfig: &AppConfig{ + UsernameReplacements: defaultUsernameReplacements, + GroupnameReplacements: defaultGroupnameReplacements, + BanBeforeRemoveDuration: 24 * time.Hour, + }, + ytUsersSetUp: []YtsaurusUser{ + aliceYtsaurus, + bobYtsaurus, + }, + azureUsersSetUp: []SourceUser{ + aliceAzure, + }, + ytUsersExpected: []YtsaurusUser{ + aliceYtsaurus, + bobYtsaurusBanned, + }, + }, { name: "bob-was-banned-now-deleted-carol-was-banned-now-back", // Bob was banned at initialTestTime, @@ -503,6 +539,11 @@ func (suite *AppTestSuite) SetupSuite() { log.Fatalf("error starting ytsaurus local container: %s", err) } + err := os.Setenv(defaultYtsaurusSecretEnvVar, ytDevToken) + if err != nil { + log.Fatalf("failed to set YT_TOKEN: %s", err) + } + ytsaurusClient, err := suite.ytsaurusLocal.GetClient() if err != nil { log.Fatalf("error creating ytsaurus local client: %s", err) @@ -510,11 +551,6 @@ func (suite *AppTestSuite) SetupSuite() { suite.ytsaurusClient = ytsaurusClient - err = os.Setenv(defaultYtsaurusSecretEnvVar, ytDevToken) - if err != nil { - log.Fatalf("failed to set YT_TOKEN: %s", err) - } - suite.initialYtsaurusUsers, suite.initialYtsaurusGroups, err = suite.getAllYtsaurusObjects() if err != nil { log.Fatalf("error getting initial ytsaurus objects: %s", err) @@ -541,7 +577,7 @@ func (suite *AppTestSuite) getAllYtsaurusObjects() (users []YtsaurusUser, groups return nil, nil, err } allGroups, err := doGetAllYtsaurusGroupsWithMembers(context.Background(), suite.ytsaurusClient, "azure") - return allUsers, allGroups, nil + return allUsers, allGroups, err } func (suite *AppTestSuite) diffYtsaurusObjects(expectedUsers []YtsaurusUser, expectedGroups []YtsaurusGroupWithMembers) (string, string) { @@ -550,7 +586,6 @@ func (suite *AppTestSuite) diffYtsaurusObjects(expectedUsers []YtsaurusUser, exp log.Fatalf("failed to get all ytsaurus objects: %s", err) } allExpectedUsers := append(suite.initialYtsaurusUsers, expectedUsers...) - allExpectedGroups := append(suite.initialYtsaurusGroups, expectedGroups...) // It seems that `users` group @members attr contains not the all users in the system: // for example it doesn't include: @@ -561,13 +596,23 @@ func (suite *AppTestSuite) diffYtsaurusObjects(expectedUsers []YtsaurusUser, exp for _, u := range expectedUsers { expectedNewUsernamesInUsersGroup = append(expectedNewUsernamesInUsersGroup, u.Username) } - for idx, group := range allExpectedGroups { - if group.Name == "users" { + + var allExpectedGroups []YtsaurusGroupWithMembers + for _, initialGroup := range suite.initialYtsaurusGroups { + group := YtsaurusGroupWithMembers{YtsaurusGroup: initialGroup.YtsaurusGroup, Members: NewStringSet()} + if initialGroup.Name != "users" { + group.Members = initialGroup.Members + } else { + for member := range initialGroup.Members.Iter() { + group.Members.Add(member) + } for _, uname := range expectedNewUsernamesInUsersGroup { - allExpectedGroups[idx].Members.Add(uname) + group.Members.Add(uname) } } + allExpectedGroups = append(allExpectedGroups, group) } + allExpectedGroups = append(allExpectedGroups, expectedGroups...) uDiff := cmp.Diff( actualUsers, @@ -616,7 +661,7 @@ func (suite *AppTestSuite) clear() { path := ypath.Path(fmt.Sprintf("//sys/groups/%s", group.Name)) err := suite.ytsaurusClient.RemoveNode(suite.ctx, path, nil) if err != nil { - log.Fatalf("failed to remove group: %s", group.Name) + log.Fatalf("failed to remove group: %s", err) } exists := true for exists { @@ -627,7 +672,6 @@ func (suite *AppTestSuite) clear() { } } } - } func (suite *AppTestSuite) syncOnce(t *testing.T, source Source, clock clock.PassiveClock, appConfig *AppConfig) { @@ -657,7 +701,7 @@ func (suite *AppTestSuite) syncOnce(t *testing.T, source Source, clock clock.Pas } func (suite *AppTestSuite) check(t *testing.T, expectedUsers []YtsaurusUser, expectedGroups []YtsaurusGroupWithMembers) { - // we have eventually here, because user removal takes some time. + // We have eventually here, because user removal takes some time. require.Eventually( t, func() bool { @@ -683,78 +727,7 @@ func (suite *AppTestSuite) check(t *testing.T, expectedUsers []YtsaurusUser, exp ) } -func (suite *AppTestSuite) TestSkipCreateRemove() { - defer suite.clear() - - t := suite.T() - passiveClock := testclock.NewFakePassiveClock(initialTestTime) - - azure := NewAzureFake() - azure.setUsers([]SourceUser{ - aliceAzure, - bobAzure, - }) - - setupYtsaurusObjects( - t, - suite.ytsaurusClient, - []YtsaurusUser{ - aliceYtsaurus, - carolYtsaurus, - }, - nil, - ) - - expectedYtsaurusUsers := []YtsaurusUser{ - aliceYtsaurus, - bobYtsaurus, - } - - suite.syncOnce(t, azure, passiveClock, nil) - - suite.check(t, expectedYtsaurusUsers, nil) -} - -func (suite *AppTestSuite) TestUserBanned() { - defer suite.clear() - - t := suite.T() - passiveClock := testclock.NewFakePassiveClock(initialTestTime) - - azure := NewAzureFake() - azure.setUsers([]SourceUser{ - aliceAzure, - }) - - setupYtsaurusObjects( - t, - suite.ytsaurusClient, - []YtsaurusUser{ - aliceYtsaurus, - bobYtsaurus, - }, - nil, - ) - - appConfig := &AppConfig{ - UsernameReplacements: defaultUsernameReplacements, - GroupnameReplacements: defaultGroupnameReplacements, - BanBeforeRemoveDuration: 24 * time.Hour, - } - suite.syncOnce(t, azure, passiveClock, appConfig) - - expectedYtsaurusUsers := []YtsaurusUser{ - aliceYtsaurus, - bobYtsaurusBanned, - } - suite.check(t, expectedYtsaurusUsers, nil) -} - -func TestAppTestSuite(t *testing.T) { - suite.Run(t, new(AppTestSuite)) -} - -// TestAppSync uses local YTsaurus container and fake Azure to test all the cases: +// TestSyncOnce uses local YTsaurus container and fake Azure to test all the cases: // [x] If Azure user not in YTsaurus -> created; // [x] If Azure user already in YTsaurus no changes -> skipped; // [x] If Azure user already in YTsaurus with changes -> updated; @@ -772,72 +745,54 @@ func TestAppTestSuite(t *testing.T) { // [x] If Azure group displayName changed AND Azure members changed -> recreate YTsaurus group with actual members set; // [x] YTsaurus group name is built according to config; // [x] Remove limits config option works. -/*func TestAppSync(t *testing.T) { - require.NoError(t, os.Setenv(defaultYtsaurusSecretEnvVar, ytDevToken)) +func (suite *AppTestSuite) TestSyncOnce() { + t := suite.T() + for _, tc := range testCases { t.Run( tc.name, func(tc testCase) func(t *testing.T) { return func(t *testing.T) { + defer suite.clear() + if tc.testTime.IsZero() { tc.testTime = initialTestTime } - clock := testclock.NewFakePassiveClock(initialTestTime) + passiveClock := testclock.NewFakePassiveClock(tc.testTime) - ytLocal := NewYtsaurusLocal() - defer func() { require.NoError(t, ytLocal.Stop()) }() - require.NoError(t, ytLocal.Start()) + if os.Getenv(runTestsWithNewYtEnvVar) != "" { + suite.TearDownSuite() + suite.SetupSuite() + } azure := NewAzureFake() azure.setUsers(tc.azureUsersSetUp) azure.setGroups(tc.azureGroupsSetUp) - ytClient, err := ytLocal.GetClient() - require.NoError(t, err) - - initialYtUsers, initialYtGroups := getAllYtsaurusObjects(t, ytClient) - setupYtsaurusObjects(t, ytClient, tc.ytUsersSetUp, tc.ytGroupsSetUp) - - if tc.appConfig == nil { - tc.appConfig = defaultAppConfig - } - app, err := NewAppCustomized( - &Config{ - App: *tc.appConfig, - Azure: &AzureConfig{}, - Ytsaurus: YtsaurusConfig{ - Proxy: ytLocal.GetProxy(), - ApplyUserChanges: true, - ApplyGroupChanges: true, - ApplyMemberChanges: true, - LogLevel: "DEBUG", - SourceAttributeName: "azure", - }, - }, getDevelopmentLogger(), - azure, - clock, + setupYtsaurusObjects( + t, + suite.ytsaurusClient, + tc.ytUsersSetUp, + tc.ytGroupsSetUp, ) - require.NoError(t, err) - app.syncOnce() + suite.syncOnce(t, azure, passiveClock, tc.appConfig) + suite.check(t, tc.ytUsersExpected, tc.ytGroupsExpected) } }(tc), ) } -}*/ +} -func TestManageUnmanagedUsersIsForbidden(t *testing.T) { - ytLocal := NewYtsaurusLocal() - defer func() { require.NoError(t, ytLocal.Stop()) }() - require.NoError(t, ytLocal.Start()) +func (suite *AppTestSuite) TestManageUnmanagedUsersIsForbidden() { + t := suite.T() - ytClient, err := ytLocal.GetClient() - require.NoError(t, err) + defer suite.clear() ytsaurus, err := NewYtsaurus( &YtsaurusConfig{ - Proxy: ytLocal.GetProxy(), + Proxy: suite.ytsaurusLocal.GetProxy(), LogLevel: "DEBUG", }, getDevelopmentLogger(), @@ -849,7 +804,7 @@ func TestManageUnmanagedUsersIsForbidden(t *testing.T) { err = doCreateYtsaurusUser( context.Background(), - ytClient, + suite.ytsaurusClient, unmanagedOleg, nil, ) @@ -874,47 +829,46 @@ func TestManageUnmanagedUsersIsForbidden(t *testing.T) { } } +func TestAppTestSuite(t *testing.T) { + suite.Run(t, new(AppTestSuite)) +} + func setupYtsaurusObjects(t *testing.T, client yt.Client, users []YtsaurusUser, groups []YtsaurusGroupWithMembers) { t.Log("Setting up ytsaurus for test") - if users != nil { - for _, user := range users { - t.Logf("creating user: %v", user) - userAttributes := buildUserAttributes(user, "azure") - userAttributes["is_test"] = true - err := doCreateYtsaurusUser( - context.Background(), - client, - user.Username, - userAttributes, - ) - require.NoError(t, err) - } + for _, user := range users { + t.Logf("creating user: %v", user) + + userAttributes := buildUserAttributes(user, "azure") + err := doCreateYtsaurusUser( + context.Background(), + client, + user.Username, + userAttributes, + ) + require.NoError(t, err) } - if groups != nil { - for _, group := range groups { - t.Log("creating group:", group) + for _, group := range groups { + t.Log("creating group:", group) + + groupAttributes := buildGroupAttributes(group.YtsaurusGroup, "azure") + err := doCreateYtsaurusGroup( + context.Background(), + client, + group.Name, + groupAttributes, + ) - groupAttributes := buildGroupAttributes(group.YtsaurusGroup, "azure") - groupAttributes["is_test"] = true - err := doCreateYtsaurusGroup( + for member := range group.Members.Iter() { + err = doAddMemberYtsaurusGroup( context.Background(), client, + member, group.Name, - groupAttributes, ) - require.NoError(t, err) - for member := range group.Members.Iter() { - err = doAddMemberYtsaurusGroup( - context.Background(), - client, - member, - group.Name, - ) - } - require.NoError(t, err) } + require.NoError(t, err) } } diff --git a/go.mod b/go.mod index cad6dfe..bb9e775 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ go 1.20 require ( github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 + github.com/containerd/containerd v1.7.12 github.com/deckarep/golang-set/v2 v2.3.1 github.com/google/go-cmp v0.6.0 github.com/jessevdk/go-flags v1.5.0 @@ -30,8 +31,8 @@ require ( github.com/andybalholm/brotli v1.0.4 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/cjlapao/common-go v0.0.39 // indirect - github.com/containerd/containerd v1.7.12 // indirect github.com/containerd/log v0.1.0 // indirect + github.com/containerd/ttrpc v1.2.2 // indirect github.com/cpuguy83/dockercfg v0.3.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/distribution/reference v0.5.0 // indirect diff --git a/go.sum b/go.sum index 795c6e1..b9371fa 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,4 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9vkmnHYOMsOr4WLk+Vo07yKIzd94sVoIqshQ4bU= @@ -11,6 +12,7 @@ github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOEl github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/AzureAD/microsoft-authentication-library-for-go v1.2.0 h1:hVeq+yCyUi+MsoO/CU95yqCIcdzra5ovzk8Q2BBpV2M= github.com/AzureAD/microsoft-authentication-library-for-go v1.2.0/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7fz8= @@ -19,12 +21,16 @@ github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cjlapao/common-go v0.0.39 h1:bAAUrj2B9v0kMzbAOhzjSmiyDy+rd56r2sy7oEiQLlA= github.com/cjlapao/common-go v0.0.39/go.mod h1:M3dzazLjTjEtZJbbxoA5ZDiGCiHmpwqW9l4UWaddwOA= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/containerd/containerd v1.7.12 h1:+KQsnv4VnzyxWcfO9mlxxELaoztsDEjOuCMPAuPqgU0= github.com/containerd/containerd v1.7.12/go.mod h1:/5OMpE1p0ylxtEUGY8kuCYkDRzJm9NO1TFMWjUpdevk= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= +github.com/containerd/ttrpc v1.2.2 h1:9vqZr0pxwOF5koz6N0N3kJ0zDHokrcPxIR/ZR2YFtOs= +github.com/containerd/ttrpc v1.2.2/go.mod h1:sIT6l32Ph/H9cvnJsfXM5drIVzTr5A2flTf1G5tYZak= github.com/cpuguy83/dockercfg v0.3.1 h1:/FpZ+JaygUR/lZP2NlFI2DVfrOEMAIKP5wWEJdoYe9E= github.com/cpuguy83/dockercfg v0.3.1/go.mod h1:sugsbF4//dDlL/i+S+rtpIWp+5h0BHJHfjj5/jFyUJc= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= @@ -42,6 +48,8 @@ github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/frankban/quicktest v1.14.5 h1:dfYrrRyLtiqT9GyKXgdh+k4inNeTvmGbuSgZ3lx3GhA= @@ -58,11 +66,18 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -135,6 +150,9 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/shirou/gopsutil/v3 v3.23.12 h1:z90NtUkp3bMtmICZKpC4+WaknU1eXtp5vtbQ11DgpE4= github.com/shirou/gopsutil/v3 v3.23.12/go.mod h1:1FrWgea594Jp7qmjHUUPlJDTPgcsb9mGnXDxavtikzM= @@ -142,6 +160,7 @@ github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFt github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= +github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/std-uritemplate/std-uritemplate/go v0.0.42 h1:rG+XlE4drkVWs2NLfGS15N+vg+CUcjXElQKvJ0fctlI= @@ -149,6 +168,7 @@ github.com/std-uritemplate/std-uritemplate/go v0.0.42/go.mod h1:Qov4Ay4U83j37Xjg github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -204,31 +224,47 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20230725093048-515e97ebf090 h1:Di6/M8l0O2lCLc6VVRWhgCiApHV8MnQurBnFSHsQtNY= golang.org/x/exp v0.0.0-20230725093048-515e97ebf090/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= @@ -240,6 +276,10 @@ golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -251,14 +291,24 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 h1:Z0hjGZePRE0ZBWotvtrwxFNrNE9CUAGtplaDK5NNI/g= google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 h1:FmF5cCW94Ij59cfpoLiwTgodWmm60eEV0CjlsVg2fuw= google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 h1:bVf09lpb+OJbByTj913DRJioFFAjf/ZGxEz7MajTp2U= google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ= google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -268,5 +318,7 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5 h1:kmDqav+P+/5e1i9tFfHq1qcF3sOrDp+YEkVDAHu7Jwk= k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= From acb6f9da1296beffc20d05673c35d37470e4b1ab Mon Sep 17 00:00:00 2001 From: Nadezhda Savchenko Date: Wed, 20 Mar 2024 18:57:36 +0300 Subject: [PATCH 4/6] Update go version - 1.22 --- .github/workflows/go.yml | 2 +- go.mod | 5 ++- go.sum | 72 +++++++++++----------------------------- 3 files changed, 23 insertions(+), 56 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 1b34c0d..2ddedff 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: '1.20' + go-version: '1.22' - name: Build run: go build -v ./... diff --git a/go.mod b/go.mod index bb9e775..ee2c2cb 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,9 @@ module github.com/nebius/ytsaurus-active-directory-integration -go 1.20 +go 1.22 require ( github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 - github.com/containerd/containerd v1.7.12 github.com/deckarep/golang-set/v2 v2.3.1 github.com/google/go-cmp v0.6.0 github.com/jessevdk/go-flags v1.5.0 @@ -31,8 +30,8 @@ require ( github.com/andybalholm/brotli v1.0.4 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/cjlapao/common-go v0.0.39 // indirect + github.com/containerd/containerd v1.7.12 // indirect github.com/containerd/log v0.1.0 // indirect - github.com/containerd/ttrpc v1.2.2 // indirect github.com/cpuguy83/dockercfg v0.3.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/distribution/reference v0.5.0 // indirect diff --git a/go.sum b/go.sum index b9371fa..54d148b 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9vkmnHYOMsOr4WLk+Vo07yKIzd94sVoIqshQ4bU= +github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.8.0 h1:9kDVnTz3vbfweTqAUmk/a/pH5pWFCHtvRpHYC0G/dcA= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.8.0/go.mod h1:3Ug6Qzto9anB6mGlEdgYMDF5zHQ+wwhEaYR4s17PHMw= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 h1:BMAjVKJM0U/CYF27gA0ZMmXGkOcvfFtD0oHVZ1TIPRI= @@ -12,7 +12,6 @@ github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOEl github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/AzureAD/microsoft-authentication-library-for-go v1.2.0 h1:hVeq+yCyUi+MsoO/CU95yqCIcdzra5ovzk8Q2BBpV2M= github.com/AzureAD/microsoft-authentication-library-for-go v1.2.0/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7fz8= @@ -21,19 +20,16 @@ github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cjlapao/common-go v0.0.39 h1:bAAUrj2B9v0kMzbAOhzjSmiyDy+rd56r2sy7oEiQLlA= github.com/cjlapao/common-go v0.0.39/go.mod h1:M3dzazLjTjEtZJbbxoA5ZDiGCiHmpwqW9l4UWaddwOA= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/containerd/containerd v1.7.12 h1:+KQsnv4VnzyxWcfO9mlxxELaoztsDEjOuCMPAuPqgU0= github.com/containerd/containerd v1.7.12/go.mod h1:/5OMpE1p0ylxtEUGY8kuCYkDRzJm9NO1TFMWjUpdevk= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= -github.com/containerd/ttrpc v1.2.2 h1:9vqZr0pxwOF5koz6N0N3kJ0zDHokrcPxIR/ZR2YFtOs= -github.com/containerd/ttrpc v1.2.2/go.mod h1:sIT6l32Ph/H9cvnJsfXM5drIVzTr5A2flTf1G5tYZak= github.com/cpuguy83/dockercfg v0.3.1 h1:/FpZ+JaygUR/lZP2NlFI2DVfrOEMAIKP5wWEJdoYe9E= github.com/cpuguy83/dockercfg v0.3.1/go.mod h1:sugsbF4//dDlL/i+S+rtpIWp+5h0BHJHfjj5/jFyUJc= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= +github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -42,17 +38,17 @@ github.com/deckarep/golang-set/v2 v2.3.1/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpO github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= +github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/docker/docker v25.0.2+incompatible h1:/OaKeauroa10K4Nqavw4zlhcDq/WBcPMc5DbjOGgozY= github.com/docker/docker v25.0.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/frankban/quicktest v1.14.5 h1:dfYrrRyLtiqT9GyKXgdh+k4inNeTvmGbuSgZ3lx3GhA= +github.com/frankban/quicktest v1.14.5/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= @@ -66,18 +62,11 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -88,6 +77,7 @@ github.com/google/tink/go v1.7.0/go.mod h1:GAUOd+QE3pgj9q8VKIGTCP33c/B7eb4NhxLcg github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 h1:YBftPWNWd4WwGqtY2yeZL2ef8rHAxPBD8KFhJpmcqms= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0/go.mod h1:YN5jB8ie0yfIUg6VvR9Kz84aCaG7AsGZnLjhHbUqwPg= github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc= github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -95,7 +85,9 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= @@ -150,17 +142,14 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/shirou/gopsutil/v3 v3.23.12 h1:z90NtUkp3bMtmICZKpC4+WaknU1eXtp5vtbQ11DgpE4= github.com/shirou/gopsutil/v3 v3.23.12/go.mod h1:1FrWgea594Jp7qmjHUUPlJDTPgcsb9mGnXDxavtikzM= github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= -github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/std-uritemplate/std-uritemplate/go v0.0.42 h1:rG+XlE4drkVWs2NLfGS15N+vg+CUcjXElQKvJ0fctlI= @@ -168,7 +157,6 @@ github.com/std-uritemplate/std-uritemplate/go v0.0.42/go.mod h1:Qov4Ay4U83j37Xjg github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -190,16 +178,21 @@ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0/go.mod h1: go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 h1:Mne5On7VWdx7omSrSSZvM4Kw7cS7NQkOOmLcgscI51U= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0/go.mod h1:IPtUMKL4O3tH5y+iXVyAXqpAwMuzC1IrxVS81rummfE= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 h1:IeMeyr1aBvBiPVYihXIaeIZba6b8E1bYp7lbdxK8CQg= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0/go.mod h1:oVdCUtjq9MK9BlS7TtucsQwUcXcymNiEDjgDD2jMtZU= go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE= go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8= go.opentelemetry.io/otel/sdk v1.19.0 h1:6USY6zH+L8uMH8L3t1enZPR3WFEmSTADlqldyHtJi3o= +go.opentelemetry.io/otel/sdk v1.19.0/go.mod h1:NedEbbS4w3C6zElbLdPJKOpJQOrGUJ+GfzpjUvI0v1A= go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg= go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= +go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= +go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= @@ -213,6 +206,7 @@ go.ytsaurus.tech/library/go/core/xerrors v0.0.3/go.mod h1:8u4Vm+WwEJceSGO3+D1m70 go.ytsaurus.tech/library/go/ptr v0.0.1 h1:TXR35NUQREmcifYt4qic7eYGIFgdc0cn+KNqkwpnsBU= go.ytsaurus.tech/library/go/ptr v0.0.1/go.mod h1:3HhS2x1phVP+4agBp7QZ7ywdOL7Jo1aYRYEyrxFbKSA= go.ytsaurus.tech/library/go/test/testhelpers v0.0.1 h1:X2y+zhLgd2y0DxF4V6HJyZwIp7rpewFKXlb+XZWGjio= +go.ytsaurus.tech/library/go/test/testhelpers v0.0.1/go.mod h1:kDwN91Sg68g0gYeYhLTA1sVlLJHdAtxZq6xWYj32TLI= go.ytsaurus.tech/library/go/x/xreflect v0.0.2 h1:S+lfg3G+WrfiBfTYz8droZeyiYYvT4mxLxEbQcNXQFs= go.ytsaurus.tech/library/go/x/xreflect v0.0.2/go.mod h1:FJB6bzAVFQxi99CZjUqDSAMu5puEjswFW9Qwj41Yyy8= go.ytsaurus.tech/library/go/x/xruntime v0.0.3 h1:/km3v+CPSuID5FsPKvE2LcwmYJPS8TcxeBMGH1MjtVs= @@ -224,47 +218,32 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20230725093048-515e97ebf090 h1:Di6/M8l0O2lCLc6VVRWhgCiApHV8MnQurBnFSHsQtNY= golang.org/x/exp v0.0.0-20230725093048-515e97ebf090/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= @@ -275,11 +254,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -291,34 +267,26 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 h1:Z0hjGZePRE0ZBWotvtrwxFNrNE9CUAGtplaDK5NNI/g= google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 h1:FmF5cCW94Ij59cfpoLiwTgodWmm60eEV0CjlsVg2fuw= +google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98/go.mod h1:rsr7RhLuwsDKL7RmgDDCUc6yaGr1iqceVb5Wv6f6YvQ= google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 h1:bVf09lpb+OJbByTj913DRJioFFAjf/ZGxEz7MajTp2U= google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ= google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +gotest.tools/v3 v3.5.0/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5 h1:kmDqav+P+/5e1i9tFfHq1qcF3sOrDp+YEkVDAHu7Jwk= k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= From bf787978b0aea79ff5b836f9fc34c0fb23067546 Mon Sep 17 00:00:00 2001 From: Nadezhda Savchenko Date: Wed, 20 Mar 2024 19:04:50 +0300 Subject: [PATCH 5/6] wip --- app_test.go | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/app_test.go b/app_test.go index 07a5f5b..9ea1f87 100644 --- a/app_test.go +++ b/app_test.go @@ -571,6 +571,13 @@ func (suite *AppTestSuite) TearDownSuite() { } } +func (suite *AppTestSuite) restartYtsaurusIfNeeded() { + if os.Getenv(runTestsWithNewYtEnvVar) != "" { + suite.TearDownSuite() + suite.SetupSuite() + } +} + func (suite *AppTestSuite) getAllYtsaurusObjects() (users []YtsaurusUser, groups []YtsaurusGroupWithMembers, err error) { allUsers, err := doGetAllYtsaurusUsers(context.Background(), suite.ytsaurusClient, "azure") if err != nil { @@ -672,6 +679,8 @@ func (suite *AppTestSuite) clear() { } } } + + suite.restartYtsaurusIfNeeded() } func (suite *AppTestSuite) syncOnce(t *testing.T, source Source, clock clock.PassiveClock, appConfig *AppConfig) { @@ -727,7 +736,7 @@ func (suite *AppTestSuite) check(t *testing.T, expectedUsers []YtsaurusUser, exp ) } -// TestSyncOnce uses local YTsaurus container and fake Azure to test all the cases: +// TestAzureSyncOnce uses local YTsaurus container and fake Azure to test all the cases: // [x] If Azure user not in YTsaurus -> created; // [x] If Azure user already in YTsaurus no changes -> skipped; // [x] If Azure user already in YTsaurus with changes -> updated; @@ -745,7 +754,7 @@ func (suite *AppTestSuite) check(t *testing.T, expectedUsers []YtsaurusUser, exp // [x] If Azure group displayName changed AND Azure members changed -> recreate YTsaurus group with actual members set; // [x] YTsaurus group name is built according to config; // [x] Remove limits config option works. -func (suite *AppTestSuite) TestSyncOnce() { +func (suite *AppTestSuite) TestAzureSyncOnce() { t := suite.T() for _, tc := range testCases { @@ -760,11 +769,6 @@ func (suite *AppTestSuite) TestSyncOnce() { } passiveClock := testclock.NewFakePassiveClock(tc.testTime) - if os.Getenv(runTestsWithNewYtEnvVar) != "" { - suite.TearDownSuite() - suite.SetupSuite() - } - azure := NewAzureFake() azure.setUsers(tc.azureUsersSetUp) azure.setGroups(tc.azureGroupsSetUp) From 25745c1d11df6f98e03d3c6f797b3ab95cf934c5 Mon Sep 17 00:00:00 2001 From: Nadezhda Savchenko Date: Thu, 21 Mar 2024 13:36:37 +0300 Subject: [PATCH 6/6] Rename env var --- .github/workflows/go.yml | 2 +- Makefile | 4 ++++ app_test.go | 6 +++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 2ddedff..7af963d 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -25,7 +25,7 @@ jobs: run: go build -v ./... - name: Test - run: RUN_TESTS_WITH_NEW_YT=yes go test -v ./... + run: go test -v ./... - name: Run golangci-lint uses: golangci/golangci-lint-action@v3.7.0 diff --git a/Makefile b/Makefile index 2d35866..be99c0a 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,10 @@ lint-fix: test: go test ./... +.PHONY: test-fast +test-fast: + REUSE_YT_CONTAINER=yes go test ./... + .PHONY: format format: go fmt diff --git a/app_test.go b/app_test.go index 9ea1f87..8da5e4a 100644 --- a/app_test.go +++ b/app_test.go @@ -22,8 +22,8 @@ import ( ) const ( - ytDevToken = "password" - runTestsWithNewYtEnvVar = "RUN_TESTS_WITH_NEW_YT" + ytDevToken = "password" + reuseYtContainerEnvVar = "REUSE_YT_CONTAINER" ) type testCase struct { @@ -572,7 +572,7 @@ func (suite *AppTestSuite) TearDownSuite() { } func (suite *AppTestSuite) restartYtsaurusIfNeeded() { - if os.Getenv(runTestsWithNewYtEnvVar) != "" { + if os.Getenv(reuseYtContainerEnvVar) != "1" && os.Getenv(reuseYtContainerEnvVar) != "yes" { suite.TearDownSuite() suite.SetupSuite() }