Skip to content

Commit

Permalink
client: Use api.ProjectDefaultName
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
  • Loading branch information
stgraber committed Oct 25, 2023
1 parent c48c99f commit 1c8bfd5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion client/incus.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (r *ProtocolIncus) GetConnectionInfo() (*ConnectionInfo, error) {

info.Project = r.project
if info.Project == "" {
info.Project = "default"
info.Project = api.ProjectDefaultName
}

info.Target = r.clusterTarget
Expand Down
6 changes: 3 additions & 3 deletions client/incus_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,10 @@ func (r *ProtocolIncus) ApplyServerPreseed(config api.InitPreseed) error {
// Populate default project if not specified for backwards compatbility with earlier
// preseed dump files.
if config.Server.Networks[i].Project == "" {
config.Server.Networks[i].Project = "default"
config.Server.Networks[i].Project = api.ProjectDefaultName
}

if config.Server.Networks[i].Project != "default" {
if config.Server.Networks[i].Project != api.ProjectDefaultName {
continue
}

Expand Down Expand Up @@ -395,7 +395,7 @@ func (r *ProtocolIncus) ApplyServerPreseed(config api.InitPreseed) error {

// Apply networks in non-default projects after project config applied (so that their projects exist).
for i := range config.Server.Networks {
if config.Server.Networks[i].Project == "default" {
if config.Server.Networks[i].Project == api.ProjectDefaultName {
continue
}

Expand Down
2 changes: 1 addition & 1 deletion client/incus_storage_volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (r *ProtocolIncus) GetStoragePoolVolumeNamesAllProjects(pool string) (map[s

project := resourceURL.Query().Get("project")
if project == "" {
project = "default"
project = api.ProjectDefaultName
}

_, after, found := strings.Cut(resourceURL.Path, fmt.Sprintf("%s/", u.URL.Path))
Expand Down

0 comments on commit 1c8bfd5

Please sign in to comment.