Skip to content

Commit

Permalink
remove mock from provisioner
Browse files Browse the repository at this point in the history
  • Loading branch information
anurag4DSB committed Dec 9, 2024
1 parent 1096a0e commit cd72872
Showing 1 changed file with 0 additions and 117 deletions.
117 changes: 0 additions & 117 deletions pkg/driver/provisioner_server_impl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,123 +25,6 @@ import (
cosiapi "sigs.k8s.io/container-object-storage-interface-spec"
)

// type MockIAMClient struct {
// CreateUserFunc func(ctx context.Context, input *iam.CreateUserInput, opts ...func(*iam.Options)) (*iam.CreateUserOutput, error)
// PutUserPolicyFunc func(ctx context.Context, input *iam.PutUserPolicyInput, opts ...func(*iam.Options)) (*iam.PutUserPolicyOutput, error)
// CreateAccessKeyFunc func(ctx context.Context, input *iam.CreateAccessKeyInput, opts ...func(*iam.Options)) (*iam.CreateAccessKeyOutput, error)
// GetUserFunc func(ctx context.Context, input *iam.GetUserInput, opts ...func(*iam.Options)) (*iam.GetUserOutput, error)
// DeleteUserPolicyFunc func(ctx context.Context, input *iam.DeleteUserPolicyInput, opts ...func(*iam.Options)) (*iam.DeleteUserPolicyOutput, error)
// ListAccessKeysFunc func(ctx context.Context, input *iam.ListAccessKeysInput, opts ...func(*iam.Options)) (*iam.ListAccessKeysOutput, error)
// DeleteAccessKeyFunc func(ctx context.Context, input *iam.DeleteAccessKeyInput, opts ...func(*iam.Options)) (*iam.DeleteAccessKeyOutput, error)
// DeleteUserFunc func(ctx context.Context, input *iam.DeleteUserInput, opts ...func(*iam.Options)) (*iam.DeleteUserOutput, error)
// CreateBucketAccessFunc func(ctx context.Context, userName, bucketName string) (*iam.CreateAccessKeyOutput, error)
// RevokeBucketAccessFunc func(ctx context.Context, userName, bucketName string) error
// }

// // Implement CreateUser
// func (m *MockIAMClient) CreateUser(ctx context.Context, input *iam.CreateUserInput, opts ...func(*iam.Options)) (*iam.CreateUserOutput, error) {
// if m.CreateUserFunc != nil {
// return m.CreateUserFunc(ctx, input, opts...)
// }
// return &iam.CreateUserOutput{
// User: &iamtypes.User{
// UserName: input.UserName,
// UserId: aws.String("mock-user-id"),
// },
// }, nil
// }

// func (m *MockIAMClient) RevokeBucketAccess(ctx context.Context, userName, bucketName string) error {
// if m.RevokeBucketAccessFunc != nil {
// return m.RevokeBucketAccessFunc(ctx, userName, bucketName)
// }
// return nil
// }

// func (m *MockIAMClient) CreateBucketAccess(ctx context.Context, userName, bucketName string) (*iam.CreateAccessKeyOutput, error) {
// if m.CreateBucketAccessFunc != nil {
// return m.CreateBucketAccessFunc(ctx, userName, bucketName)
// }
// return &iam.CreateAccessKeyOutput{
// AccessKey: &iamtypes.AccessKey{
// AccessKeyId: aws.String("mock-access-key-id"),
// SecretAccessKey: aws.String("mock-secret-access-key"),
// },
// }, nil
// }

// // Implement PutUserPolicy
// func (m *MockIAMClient) PutUserPolicy(ctx context.Context, input *iam.PutUserPolicyInput, opts ...func(*iam.Options)) (*iam.PutUserPolicyOutput, error) {
// if m.PutUserPolicyFunc != nil {
// return m.PutUserPolicyFunc(ctx, input, opts...)
// }
// return &iam.PutUserPolicyOutput{}, nil
// }

// // Implement CreateAccessKey
// func (m *MockIAMClient) CreateAccessKey(ctx context.Context, input *iam.CreateAccessKeyInput, opts ...func(*iam.Options)) (*iam.CreateAccessKeyOutput, error) {
// if m.CreateAccessKeyFunc != nil {
// return m.CreateAccessKeyFunc(ctx, input, opts...)
// }
// return &iam.CreateAccessKeyOutput{
// AccessKey: &iamtypes.AccessKey{
// AccessKeyId: aws.String("mock-access-key-id"),
// SecretAccessKey: aws.String("mock-secret-access-key"),
// },
// }, nil
// }

// // Implement GetUser
// func (m *MockIAMClient) GetUser(ctx context.Context, input *iam.GetUserInput, opts ...func(*iam.Options)) (*iam.GetUserOutput, error) {
// if m.GetUserFunc != nil {
// return m.GetUserFunc(ctx, input, opts...)
// }
// return &iam.GetUserOutput{
// User: &iamtypes.User{
// UserName: input.UserName,
// UserId: aws.String("mock-user-id"),
// },
// }, nil
// }

// // Implement DeleteUserPolicy
// func (m *MockIAMClient) DeleteUserPolicy(ctx context.Context, input *iam.DeleteUserPolicyInput, opts ...func(*iam.Options)) (*iam.DeleteUserPolicyOutput, error) {
// if m.DeleteUserPolicyFunc != nil {
// return m.DeleteUserPolicyFunc(ctx, input, opts...)
// }
// return &iam.DeleteUserPolicyOutput{}, nil
// }

// // Implement ListAccessKeys
// func (m *MockIAMClient) ListAccessKeys(ctx context.Context, input *iam.ListAccessKeysInput, opts ...func(*iam.Options)) (*iam.ListAccessKeysOutput, error) {
// if m.ListAccessKeysFunc != nil {
// return m.ListAccessKeysFunc(ctx, input, opts...)
// }
// return &iam.ListAccessKeysOutput{
// AccessKeyMetadata: []iamtypes.AccessKeyMetadata{
// {
// AccessKeyId: aws.String("mock-access-key-id"),
// },
// },
// }, nil
// }

// // Implement DeleteAccessKey
// func (m *MockIAMClient) DeleteAccessKey(ctx context.Context, input *iam.DeleteAccessKeyInput, opts ...func(*iam.Options)) (*iam.DeleteAccessKeyOutput, error) {
// if m.DeleteAccessKeyFunc != nil {
// return m.DeleteAccessKeyFunc(ctx, input, opts...)
// }
// return &iam.DeleteAccessKeyOutput{}, nil
// }

// // Implement DeleteUser
// func (m *MockIAMClient) DeleteUser(ctx context.Context, input *iam.DeleteUserInput, opts ...func(*iam.Options)) (*iam.DeleteUserOutput, error) {
// if m.DeleteUserFunc != nil {
// return m.DeleteUserFunc(ctx, input, opts...)
// }
// return &iam.DeleteUserOutput{}, nil
// }

var _ = Describe("ProvisionerServer DriverCreateBucket", Ordered, func() {
var (
mockS3 *mock.MockS3Client
Expand Down

0 comments on commit cd72872

Please sign in to comment.