Leakage of apiserver dependencies into api package
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Triaged
|
Undecided
|
Unassigned |
Bug Description
Importing the `github.
```
#! /bin/sh -e
rm -fr test-juju
mkdir test-juju
cd test-juju
go mod init test-juju
# Add simple main file that instantiates a charm client.
cat <<EOF > main.go
package main
import (
"github.
"github.
)
func main() {
connector, _ := connector.
conn, _ := connector.Connect()
charms.
}
EOF
cat <<EOF >> go.mod
// Exclude some modules that cause an ambiguous import failure.
exclude (
cloud.
cloud.
cloud.
)
EOF
go mod tidy
# Some non-API packages used:
go mod why github.
go mod why github.
go mod why github.
# AWS SDK is imported (I'm not sure this is intentional and should be included in client code).
go mod why github.
```
The reason the AWS SDK is imported is because the charm api has a downloader client that used the s3 API to download charm binaries. But I am not sure this is currently used, and if it is, it should be server side I think. We can look to see if this can be removed.
In the Juju main branch (4.0), many of the dependencies on apiserver, state etc have already been removed.
The only thing that currently brings these in are tests, and the affected tests will be updated soon.
The caas dependency is a type alias and will be removed as soon as support for podspec charms is dropped.