Update constructor function name

This commit is contained in:
Volodymyr Zotov
2025-06-16 19:45:23 -05:00
parent 475860a364
commit cff4d194ba
2 changed files with 3 additions and 3 deletions

View File

@@ -152,7 +152,7 @@ func main() {
} }
// Setup One Password Client // Setup One Password Client
opClient, err := opclient.NewClient(version.OperatorVersion) opClient, err := opclient.NewFromEnvironment(version.OperatorVersion)
if err != nil { if err != nil {
setupLog.Error(err, "unable to create 1Password client") setupLog.Error(err, "unable to create 1Password client")
os.Exit(1) os.Exit(1)

View File

@@ -18,8 +18,8 @@ type Client interface {
GetVaultsByTitle(title string) ([]model.Vault, error) GetVaultsByTitle(title string) ([]model.Vault, error)
} }
// NewClient creates a new 1Password client based on the provided configuration. // NewFromEnvironment creates a new 1Password client based on the provided configuration.
func NewClient(integrationVersion string) (Client, error) { func NewFromEnvironment(integrationVersion string) (Client, error) {
connectHost, _ := os.LookupEnv("OP_CONNECT_HOST") connectHost, _ := os.LookupEnv("OP_CONNECT_HOST")
connectToken, _ := os.LookupEnv("OP_CONNECT_TOKEN") connectToken, _ := os.LookupEnv("OP_CONNECT_TOKEN")
serviceAccountToken, _ := os.LookupEnv("OP_SERVICE_ACCOUNT_TOKEN") serviceAccountToken, _ := os.LookupEnv("OP_SERVICE_ACCOUNT_TOKEN")