diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2020-06-09 20:45:51 -0400 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2020-06-10 05:49:41 -0400 |
commit | 87718c4e676dc503f67ca6f283c4242cf19f9eb7 (patch) | |
tree | fab6dcb9e6c497cb1155b864bcc2085550d23969 /pkg/api/handlers/utils | |
parent | 4bb43b898d72cb938d317055e4ade2771cfc9c54 (diff) | |
download | podman-87718c4e676dc503f67ca6f283c4242cf19f9eb7.tar.gz podman-87718c4e676dc503f67ca6f283c4242cf19f9eb7.tar.bz2 podman-87718c4e676dc503f67ca6f283c4242cf19f9eb7.zip |
Fix Id->ID where possible for lint
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg/api/handlers/utils')
-rw-r--r-- | pkg/api/handlers/utils/handler.go | 24 | ||||
-rw-r--r-- | pkg/api/handlers/utils/handler_test.go | 4 | ||||
-rw-r--r-- | pkg/api/handlers/utils/pods.go | 4 |
3 files changed, 16 insertions, 16 deletions
diff --git a/pkg/api/handlers/utils/handler.go b/pkg/api/handlers/utils/handler.go index 2f4a54b98..62fdc05dd 100644 --- a/pkg/api/handlers/utils/handler.go +++ b/pkg/api/handlers/utils/handler.go @@ -28,27 +28,27 @@ const ( // CompatTree supports Libpod endpoints CompatTree - // CurrentApiVersion announces what is the current API level - CurrentApiVersion = VersionLevel(iota) - // MinimalApiVersion announces what is the oldest API level supported - MinimalApiVersion + // CurrentAPIVersion announces what is the current API level + CurrentAPIVersion = VersionLevel(iota) + // MinimalAPIVersion announces what is the oldest API level supported + MinimalAPIVersion ) var ( // See https://docs.docker.com/engine/api/v1.40/ // libpod compat handlers are expected to honor docker API versions - // ApiVersion provides the current and minimal API versions for compat and libpod endpoint trees + // APIVersion provides the current and minimal API versions for compat and libpod endpoint trees // Note: GET|HEAD /_ping is never versioned and provides the API-Version and Libpod-API-Version headers to allow // clients to shop for the Version they wish to support - ApiVersion = map[VersionTree]map[VersionLevel]semver.Version{ + APIVersion = map[VersionTree]map[VersionLevel]semver.Version{ LibpodTree: { - CurrentApiVersion: semver.MustParse("1.0.0"), - MinimalApiVersion: semver.MustParse("1.0.0"), + CurrentAPIVersion: semver.MustParse("1.0.0"), + MinimalAPIVersion: semver.MustParse("1.0.0"), }, CompatTree: { - CurrentApiVersion: semver.MustParse("1.40.0"), - MinimalApiVersion: semver.MustParse("1.24.0"), + CurrentAPIVersion: semver.MustParse("1.40.0"), + MinimalAPIVersion: semver.MustParse("1.24.0"), }, } @@ -103,8 +103,8 @@ func SupportedVersionWithDefaults(r *http.Request) (semver.Version, error) { } return SupportedVersion(r, - fmt.Sprintf(">=%s <=%s", ApiVersion[tree][MinimalApiVersion].String(), - ApiVersion[tree][CurrentApiVersion].String())) + fmt.Sprintf(">=%s <=%s", APIVersion[tree][MinimalAPIVersion].String(), + APIVersion[tree][CurrentAPIVersion].String())) } // WriteResponse encodes the given value as JSON or string and renders it for http client diff --git a/pkg/api/handlers/utils/handler_test.go b/pkg/api/handlers/utils/handler_test.go index 6009432b5..d9fd22b80 100644 --- a/pkg/api/handlers/utils/handler_test.go +++ b/pkg/api/handlers/utils/handler_test.go @@ -12,12 +12,12 @@ import ( func TestSupportedVersion(t *testing.T) { req, err := http.NewRequest("GET", - fmt.Sprintf("/v%s/libpod/testing/versions", ApiVersion[LibpodTree][CurrentApiVersion]), + fmt.Sprintf("/v%s/libpod/testing/versions", APIVersion[LibpodTree][CurrentAPIVersion]), nil) if err != nil { t.Fatal(err) } - req = mux.SetURLVars(req, map[string]string{"version": ApiVersion[LibpodTree][CurrentApiVersion].String()}) + req = mux.SetURLVars(req, map[string]string{"version": APIVersion[LibpodTree][CurrentAPIVersion].String()}) rr := httptest.NewRecorder() handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { diff --git a/pkg/api/handlers/utils/pods.go b/pkg/api/handlers/utils/pods.go index 5b6f6d34d..4a5cbd05c 100644 --- a/pkg/api/handlers/utils/pods.go +++ b/pkg/api/handlers/utils/pods.go @@ -54,7 +54,7 @@ func GetPods(w http.ResponseWriter, r *http.Request) ([]*entities.ListPodsReport if err != nil { return nil, err } - infraId, err := pod.InfraContainerID() + infraID, err := pod.InfraContainerID() if err != nil { return nil, err } @@ -65,7 +65,7 @@ func GetPods(w http.ResponseWriter, r *http.Request) ([]*entities.ListPodsReport Name: pod.Name(), Namespace: pod.Namespace(), Status: status, - InfraId: infraId, + InfraId: infraID, Labels: pod.Labels(), } for _, ctr := range ctrs { |