UpdateProjectVariables implements drivers.AdminService.
(ctx context.Context, environment string, variables map[string]string)
| 135 | |
| 136 | // UpdateProjectVariables implements drivers.AdminService. |
| 137 | func (l *localAdminService) UpdateProjectVariables(ctx context.Context, environment string, variables map[string]string) error { |
| 138 | if l.ch.AdminToken() == "" { |
| 139 | return drivers.ErrNotAuthenticated |
| 140 | } |
| 141 | |
| 142 | client, err := l.ch.Client() |
| 143 | if err != nil { |
| 144 | return err |
| 145 | } |
| 146 | |
| 147 | projects, err := l.ch.InferProjects(ctx, l.ch.Org, l.root) |
| 148 | if err != nil { |
| 149 | return err |
| 150 | } |
| 151 | project := projects[0] |
| 152 | |
| 153 | _, err = client.UpdateProjectVariables(ctx, &adminv1.UpdateProjectVariablesRequest{ |
| 154 | Org: project.OrgName, |
| 155 | Project: project.Name, |
| 156 | Environment: environment, |
| 157 | Variables: variables, |
| 158 | }) |
| 159 | return err |
| 160 | } |
| 161 | |
| 162 | // HasAnonymousSourceAccess implements [drivers.Driver]. |
| 163 | func (l *localAdminService) HasAnonymousSourceAccess(ctx context.Context, srcProps map[string]any, logger *zap.Logger) (bool, error) { |
nothing calls this directly
no test coverage detected