Created
August 2, 2022 13:02
-
-
Save chanwit/d2725cdc52f49c585124769c25559448 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package run_test | |
import ( | |
"context" | |
"sigs.k8s.io/controller-runtime/pkg/client" | |
) | |
type stateInstallDevBucketServer string | |
// mock controller-runtime client | |
type mockClientForInstallDevBucketServer struct { | |
client.Client | |
state stateInstallDevBucketServer | |
} | |
const ( | |
stateUnknown stateInstallDevBucketServer = "unknown" | |
stateNotInstalled stateInstallDevBucketServer = "not-installed" | |
stateInstalled stateInstallDevBucketServer = "installed" | |
) | |
func (c *mockClientForInstallDevBucketServer) List(_ context.Context, list client.ObjectList, _ ...client.ListOption) error { | |
switch c.state { | |
case stateUnknown: | |
return nil | |
case stateNotInstalled: | |
return nil | |
case stateInstalled: | |
return nil | |
} | |
return nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment