From 8bb4df683fded472a5a6662a788f37802105edfb Mon Sep 17 00:00:00 2001 From: Scott Cranton Date: Fri, 10 May 2019 16:27:36 -0400 Subject: [PATCH] Added package management update during release (#33) * Added updating package manager formulas during release * goimport updates * make generated-code updates --- Gopkg.lock | 171 +++++++++++++++++- Gopkg.toml | 2 +- .../v0.2.5/package-management-update.yaml | 3 + ci/upload_github_release_assets.go | 64 ++++++- docs/cli/sqoopctl.md | 22 +-- docs/cli/sqoopctl_install.md | 7 +- docs/cli/sqoopctl_install_kube.md | 5 +- docs/cli/sqoopctl_resolvermap.md | 7 +- docs/cli/sqoopctl_resolvermap_register.md | 2 +- docs/cli/sqoopctl_resolvermap_reset.md | 2 +- docs/cli/sqoopctl_schema.md | 7 +- docs/cli/sqoopctl_schema_create.md | 2 +- docs/cli/sqoopctl_schema_delete.md | 2 +- docs/cli/sqoopctl_schema_update.md | 2 +- docs/cli/sqoopctl_uninstall.md | 10 +- pkg/api/v1/api_snapshot.sk.go | 32 ++++ test/testdata/utils.go | 6 +- test/unit/executable_resolvers_test.go | 1 - 18 files changed, 293 insertions(+), 54 deletions(-) create mode 100644 changelog/v0.2.5/package-management-update.yaml diff --git a/Gopkg.lock b/Gopkg.lock index 26c568c..ce5b3b4 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -212,6 +212,21 @@ pruneopts = "UT" revision = "6480d4af844c189cf5dd913db24ddd339d3a4f85" +[[projects]] + digest = "1:b498b36dbb2b306d1c5205ee5236c9e60352be8f9eea9bf08186723a9f75b4f3" + name = "github.com/emirpasic/gods" + packages = [ + "containers", + "lists", + "lists/arraylist", + "trees", + "trees/binaryheap", + "utils", + ] + pruneopts = "UT" + revision = "1615341f118ae12f353cc8a983f35b584342c9b3" + version = "v1.12.0" + [[projects]] digest = "1:c76178e75235ac60b036c8aa39e870ee248c3ef82e6ce70a01806d870cec7383" name = "github.com/envoyproxy/go-control-plane" @@ -671,6 +686,14 @@ revision = "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75" version = "v1.0" +[[projects]] + branch = "master" + digest = "1:62fe3a7ea2050ecbd753a71889026f83d73329337ada66325cbafd5dea5f713d" + name = "github.com/jbenet/go-context" + packages = ["io"] + pruneopts = "UT" + revision = "d14ea06fba99483203c19d92cfcd13ebe73135f4" + [[projects]] digest = "1:eaefc85d32c03e5f0c2b88ea2f79fce3d993e2c78316d21319575dd4ea9153ca" name = "github.com/json-iterator/go" @@ -695,6 +718,14 @@ pruneopts = "UT" revision = "95032a82bc518f77982ea72343cc1ade730072f0" +[[projects]] + digest = "1:ae5f4d0779a45e2cb3075d8b3ece6c623e171407f4aac83521392ff06d188871" + name = "github.com/kevinburke/ssh_config" + packages = ["."] + pruneopts = "UT" + revision = "81db2a75821ed34e682567d48be488a1c3121088" + version = "0.5" + [[projects]] digest = "1:0a69a1c0db3591fcefb47f115b224592c8dfa4368b7ba9fae509d5e16cdc95c8" name = "github.com/konsorten/go-windows-terminal-sequences" @@ -875,6 +906,14 @@ revision = "279bed98673dd5bef374d3b6e4b09e2af76183bf" version = "v1.0.0-rc1" +[[projects]] + digest = "1:b2ee62e09bec113cf086d2ce0769efcc7bf79481aba8373fd8f7884e94df3462" + name = "github.com/pelletier/go-buffruneio" + packages = ["."] + pruneopts = "UT" + revision = "c37440a7cf42ac63b919c752ca73a85067e05992" + version = "v0.2.0" + [[projects]] digest = "1:95741de3af260a92cc5c7f3f3061e85273f5a81b5db20d4bd68da74bd521675e" name = "github.com/pelletier/go-toml" @@ -984,6 +1023,14 @@ revision = "572520ed46dbddaed19ea3d9541bdd0494163693" version = "v0.1" +[[projects]] + digest = "1:d917313f309bda80d27274d53985bc65651f81a5b66b820749ac7f8ef061fd04" + name = "github.com/sergi/go-diff" + packages = ["diffmatchpatch"] + pruneopts = "UT" + revision = "1744e2970ca51c86172c8190fadad617561ed6e7" + version = "v1.0.0" + [[projects]] digest = "1:afac92ed8b072133d8eb2c65875491b4f6a25727c4ff59575ad7a4b06489b040" name = "github.com/solo-io/gloo" @@ -1026,7 +1073,7 @@ version = "0.0.4" [[projects]] - digest = "1:3f550e47b57c3a38041726956a0a9cf99880835fd4376ee2d2a393424b2b49d2" + digest = "1:1035eb593ed3483de0c7c0a1ec33e7f88157dfdf8c812dbc4585fecec403ae43" name = "github.com/solo-io/go-utils" packages = [ "changelogutils", @@ -1037,13 +1084,14 @@ "githubutils", "kubeutils", "logger", + "pkgmgmtutils", "protoutils", "stats", "versionutils", ] pruneopts = "UT" - revision = "167df0ee2b8bde9d0944f00c650f19772b25d36b" - version = "v0.3.1" + revision = "a27432d89f419897df796a17456410e49a9727c3" + version = "v0.7.11" [[projects]] digest = "1:b57738f0edd82fb89ffeabbd92550f87ed40863ff08e5c25475bb1ed1d00cd3d" @@ -1131,6 +1179,19 @@ revision = "583c0c0531f06d5278b7d917446061adc344b5cd" version = "v1.0.1" +[[projects]] + digest = "1:e4ed0afd67bf7be353921665cdac50834c867ff1bba153efc0745b755a7f5905" + name = "github.com/src-d/gcfg" + packages = [ + ".", + "scanner", + "token", + "types", + ] + pruneopts = "UT" + revision = "1ac3a1ac202429a54835fe8408a92880156b489d" + version = "v1.4.0" + [[projects]] digest = "1:9deeaaf623bd5bff1aff7317417ffcd960557afa3b1a1dc27ca800a416a4b6a3" name = "github.com/technosophos/moniker" @@ -1155,6 +1216,14 @@ pruneopts = "UT" revision = "6b3b338d5f9c8b5a80ad4ea1e2e37aa58677ea9d" +[[projects]] + digest = "1:172f94a6b3644a8f9e6b5e5b7fc9fe1e42d424f52a0300b2e7ab1e57db73f85d" + name = "github.com/xanzy/ssh-agent" + packages = ["."] + pruneopts = "UT" + revision = "6a3e2ff9e7c564f36873c2e36413f634534f1c44" + version = "v0.2.1" + [[projects]] digest = "1:520b3fe2981935aec909ea78b4db76912e47235d9aea024212ffd11ae3b88dbb" name = "go.opencensus.io" @@ -1212,13 +1281,27 @@ [[projects]] branch = "master" - digest = "1:28c92854b02898c94c1d983db50970fb7d9b3ee31c3ae02b1c6afc665abcc46e" + digest = "1:181682c38255bd51f4e6866a7d36573600cbd9c2ca9614ab50dad5ab383163ff" name = "golang.org/x/crypto" packages = [ + "cast5", + "curve25519", "ed25519", "ed25519/internal/edwards25519", + "internal/chacha20", + "internal/subtle", + "openpgp", + "openpgp/armor", + "openpgp/elgamal", + "openpgp/errors", + "openpgp/packet", + "openpgp/s2k", "pbkdf2", + "poly1305", "scrypt", + "ssh", + "ssh/agent", + "ssh/knownhosts", "ssh/terminal", ] pruneopts = "UT" @@ -1423,6 +1506,70 @@ revision = "e94fb177d3668d35ab39c61cbb2f311550557e83" version = "v2.2.2" +[[projects]] + digest = "1:866df945fc92cd221d2b384dca7de5f3131a6113b9f72a7a8019ae5046abe828" + name = "gopkg.in/src-d/go-billy.v4" + packages = [ + ".", + "helper/chroot", + "helper/polyfill", + "osfs", + "util", + ] + pruneopts = "UT" + revision = "982626487c60a5252e7d0b695ca23fb0fa2fd670" + version = "v4.3.0" + +[[projects]] + digest = "1:7fcf8681ff737e3fa6b387448717283c2053058c5d7344c22a9a025b0dc5be4a" + name = "gopkg.in/src-d/go-git.v4" + packages = [ + ".", + "config", + "internal/revision", + "internal/url", + "plumbing", + "plumbing/cache", + "plumbing/filemode", + "plumbing/format/config", + "plumbing/format/diff", + "plumbing/format/gitignore", + "plumbing/format/idxfile", + "plumbing/format/index", + "plumbing/format/objfile", + "plumbing/format/packfile", + "plumbing/format/pktline", + "plumbing/object", + "plumbing/protocol/packp", + "plumbing/protocol/packp/capability", + "plumbing/protocol/packp/sideband", + "plumbing/revlist", + "plumbing/storer", + "plumbing/transport", + "plumbing/transport/client", + "plumbing/transport/file", + "plumbing/transport/git", + "plumbing/transport/http", + "plumbing/transport/internal/common", + "plumbing/transport/server", + "plumbing/transport/ssh", + "storage", + "storage/filesystem", + "storage/filesystem/dotgit", + "storage/memory", + "utils/binary", + "utils/diff", + "utils/ioutil", + "utils/merkletrie", + "utils/merkletrie/filesystem", + "utils/merkletrie/index", + "utils/merkletrie/internal/frame", + "utils/merkletrie/noder", + ] + pruneopts = "UT" + revision = "aa6f288c256ff8baf8a7745546a9752323dc0d89" + version = "v4.11.0" + [[projects]] digest = "1:3c839a777de0e6da035c9de900b60cbec463b0a89351192c1ea083eaf9e0fce0" name = "gopkg.in/tomb.v1" @@ -1430,6 +1577,14 @@ pruneopts = "UT" revision = "c131134a1947e9afd9cecfe11f4c6dff0732ae58" +[[projects]] + digest = "1:78d374b493e747afa9fbb2119687e3740a7fb8d0ebabddfef0a012593aaecbb3" + name = "gopkg.in/warnings.v0" + packages = ["."] + pruneopts = "UT" + revision = "ec4a0fea49c7b46c2aeb0b51aac55779c607e52b" + version = "v0.1.2" + [[projects]] digest = "1:342378ac4dcb378a5448dd723f0784ae519383532f5e70ade24132c4c8693202" name = "gopkg.in/yaml.v2" @@ -1952,10 +2107,8 @@ "github.com/pelletier/go-toml", "github.com/pkg/errors", "github.com/solo-io/gloo/install/helm/gloo/generate", - "github.com/solo-io/gloo/pkg/cliutil", "github.com/solo-io/gloo/pkg/cliutil/install", "github.com/solo-io/gloo/pkg/utils/setuputils", - "github.com/solo-io/gloo/projects/gloo/cli/pkg/constants", "github.com/solo-io/gloo/projects/gloo/cli/pkg/helpers", "github.com/solo-io/gloo/projects/gloo/pkg/api/v1", "github.com/solo-io/gloo/projects/gloo/pkg/api/v1/plugins/rest", @@ -1963,9 +2116,10 @@ "github.com/solo-io/go-checkpoint", "github.com/solo-io/go-utils/cliutils", "github.com/solo-io/go-utils/docsutils", - "github.com/solo-io/go-utils/errors", "github.com/solo-io/go-utils/githubutils", "github.com/solo-io/go-utils/kubeutils", + "github.com/solo-io/go-utils/logger", + "github.com/solo-io/go-utils/pkgmgmtutils", "github.com/solo-io/go-utils/stats", "github.com/solo-io/go-utils/versionutils", "github.com/solo-io/solo-kit/pkg/api/v1/clients", @@ -2011,7 +2165,10 @@ "k8s.io/client-go/plugin/pkg/client/auth", "k8s.io/client-go/plugin/pkg/client/auth/gcp", "k8s.io/client-go/rest", + "k8s.io/client-go/util/homedir", "k8s.io/helm/pkg/chartutil", + "k8s.io/helm/pkg/hooks", + "k8s.io/helm/pkg/manifest", "k8s.io/helm/pkg/renderutil", "sigs.k8s.io/yaml", ] diff --git a/Gopkg.toml b/Gopkg.toml index a91a8f4..632af5d 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -66,4 +66,4 @@ [[override]] name = "github.com/solo-io/go-utils" - version = "0.3.1" + version = "0.7.11" diff --git a/changelog/v0.2.5/package-management-update.yaml b/changelog/v0.2.5/package-management-update.yaml new file mode 100644 index 0000000..a1197b8 --- /dev/null +++ b/changelog/v0.2.5/package-management-update.yaml @@ -0,0 +1,3 @@ +changelog: + - type: NON_USER_FACING + description: Added auto update of packagement management formulas as part of release process diff --git a/ci/upload_github_release_assets.go b/ci/upload_github_release_assets.go index 009e488..a32ecaf 100644 --- a/ci/upload_github_release_assets.go +++ b/ci/upload_github_release_assets.go @@ -1,35 +1,85 @@ package main -import "github.com/solo-io/go-utils/githubutils" +import ( + "github.com/solo-io/go-utils/githubutils" + "github.com/solo-io/go-utils/logger" + "github.com/solo-io/go-utils/pkgmgmtutils" +) func main() { + const buildDir = "_output" + const repoOwner = "solo-io" + const repoName = "sqoop" + assets := make([]githubutils.ReleaseAssetSpec, 4) assets[0] = githubutils.ReleaseAssetSpec{ Name: "sqoopctl-linux-amd64", - ParentPath: "_output", + ParentPath: buildDir, UploadSHA: true, } assets[1] = githubutils.ReleaseAssetSpec{ Name: "sqoopctl-darwin-amd64", - ParentPath: "_output", + ParentPath: buildDir, UploadSHA: true, } assets[2] = githubutils.ReleaseAssetSpec{ Name: "sqoopctl-windows-amd64.exe", - ParentPath: "_output", + ParentPath: buildDir, UploadSHA: true, } assets[3] = githubutils.ReleaseAssetSpec{ Name: "sqoop.yaml", ParentPath: "install/manifest", } + spec := githubutils.UploadReleaseAssetSpec{ - Owner: "solo-io", - Repo: "sqoop", + Owner: repoOwner, + Repo: repoName, Assets: assets, SkipAlreadyExists: true, } githubutils.UploadReleaseAssetCli(&spec) -} + fOpts := []pkgmgmtutils.FormulaOptions{ + { + Name: "homebrew-tap/sqoop", + FormulaName: "sqoop", + Path: "Formula/sqoop.rb", + RepoOwner: repoOwner, // Make change in this repo owner + RepoName: "homebrew-tap", // expects this repo is forked from PRRepoOwner if PRRepoOwner != RepoOwner + PRRepoOwner: repoOwner, // Make PR to this repo owner + PRRepoName: "homebrew-tap", // and this repo + PRBranch: "master", // and merge into this branch + PRDescription: "", + PRCommitName: "Solo-io Bot", + PRCommitEmail: "bot@solo.io", + VersionRegex: `version\s*"([0-9.]+)"`, + DarwinShaRegex: `url\s*".*-darwin.*\W*sha256\s*"(.*)"`, + LinuxShaRegex: `url\s*".*-linux.*\W*sha256\s*"(.*)"`, + }, + } + + // Update package manager install formulas + status, err := pkgmgmtutils.UpdateFormulas(repoOwner, repoName, buildDir, + `sqoopctl-(darwin|linux|windows).*\.sha256`, fOpts) + if err != nil { + logger.Fatalf("Error trying to update package manager formulas. Error was: %s", err.Error()) + } + for _, s := range status { + if !s.Updated { + if s.Err != nil { + logger.Fatalf("Error while trying to update formula %s. Error was: %s", s.Name, s.Err.Error()) + } else { + logger.Fatalf("Error while trying to update formula %s. Error was nil", s.Name) // Shouldn't happen; really bad if it does + } + } + if s.Err != nil { + if s.Err == pkgmgmtutils.ErrAlreadyUpdated { + logger.Warnf("Formula %s was updated externally, so no updates applied during this release", s.Name) + } else { + logger.Fatalf("Error updating Formula %s. Error was: %s", s.Name, s.Err.Error()) + } + } + } +} diff --git a/docs/cli/sqoopctl.md b/docs/cli/sqoopctl.md index 7164190..62d4b05 100644 --- a/docs/cli/sqoopctl.md +++ b/docs/cli/sqoopctl.md @@ -4,19 +4,13 @@ weight: 5 --- ## sqoopctl -Interact with Sqoop's storage API from the command line +Interact with Sqoop's storage API from the command line. +For more information, visit https://sqoop.solo.io. ### Synopsis -As Sqoop features a storage-based API, direct communication with the Sqoop server is not necessary. sqoopctl simplifies the administration of Sqoop by providing an easy way to create, read, update, and delete Sqoop storage objects. - -The primary concerns of sqoopctl are Schemas and ResolverMaps. Schemas contain your GraphQL schema; ResolverMaps define how your schema fields are resolved. - -Start by creating a schema using sqoopctl schema create --from-file - -``` -sqoopctl [flags] -``` +Interact with Sqoop's storage API from the command line. +For more information, visit https://sqoop.solo.io. ### Options @@ -29,8 +23,8 @@ sqoopctl [flags] ### SEE ALSO -* [sqoopctl install](../sqoopctl_install) - install gloo on different platforms -* [sqoopctl resolvermap](../sqoopctl_resolvermap) - -* [sqoopctl schema](../sqoopctl_schema) - -* [sqoopctl uninstall](../sqoopctl_uninstall) - uninstall gloo +* [sqoopctl install](../sqoopctl_install) - install sqoop on different platforms (into gloo-system namespace by default) +* [sqoopctl resolvermap](../sqoopctl_resolvermap) - interacting with sqoop resolver maps +* [sqoopctl schema](../sqoopctl_schema) - interacting with sqoop schema resources +* [sqoopctl uninstall](../sqoopctl_uninstall) - uninstall sqoop and remove namespace (gloo-system by default) diff --git a/docs/cli/sqoopctl_install.md b/docs/cli/sqoopctl_install.md index 072867d..90f3c40 100644 --- a/docs/cli/sqoopctl_install.md +++ b/docs/cli/sqoopctl_install.md @@ -4,11 +4,11 @@ weight: 5 --- ## sqoopctl install -install gloo on different platforms +install sqoop on different platforms (into gloo-system namespace by default) ### Synopsis -choose which version of Gloo to install. +choose which version of Sqoop to install. ### Options @@ -26,6 +26,7 @@ choose which version of Gloo to install. ### SEE ALSO -* [sqoopctl](../sqoopctl) - Interact with Sqoop's storage API from the command line +* [sqoopctl](../sqoopctl) - Interact with Sqoop's storage API from the command line. +For more information, visit https://sqoop.solo.io. * [sqoopctl install kube](../sqoopctl_install_kube) - install sqoop on kubernetes diff --git a/docs/cli/sqoopctl_install_kube.md b/docs/cli/sqoopctl_install_kube.md index 62db25a..2fa64c5 100644 --- a/docs/cli/sqoopctl_install_kube.md +++ b/docs/cli/sqoopctl_install_kube.md @@ -19,8 +19,7 @@ sqoopctl install kube [flags] ``` -d, --dry-run Dump the raw installation yaml instead of applying it to kubernetes -h, --help help for kube - -n, --namespace string which namespace to install sqoop into (default "sqoop-system") - --release string install using this release version. defaults to the latest github release + -n, --namespace string which namespace to install sqoop into (default "gloo-system") ``` ### Options inherited from parent commands @@ -33,5 +32,5 @@ sqoopctl install kube [flags] ### SEE ALSO -* [sqoopctl install](../sqoopctl_install) - install gloo on different platforms +* [sqoopctl install](../sqoopctl_install) - install sqoop on different platforms (into gloo-system namespace by default) diff --git a/docs/cli/sqoopctl_resolvermap.md b/docs/cli/sqoopctl_resolvermap.md index c5fbaf2..79ac974 100644 --- a/docs/cli/sqoopctl_resolvermap.md +++ b/docs/cli/sqoopctl_resolvermap.md @@ -4,11 +4,11 @@ weight: 5 --- ## sqoopctl resolvermap - +interacting with sqoop resolver maps ### Synopsis - +interacting with sqoop resolver maps ### Options @@ -26,7 +26,8 @@ weight: 5 ### SEE ALSO -* [sqoopctl](../sqoopctl) - Interact with Sqoop's storage API from the command line +* [sqoopctl](../sqoopctl) - Interact with Sqoop's storage API from the command line. +For more information, visit https://sqoop.solo.io. * [sqoopctl resolvermap register](../sqoopctl_resolvermap_register) - Register a resolver for a field in your Schema * [sqoopctl resolvermap reset](../sqoopctl_resolvermap_reset) - reset a resolver map by its name diff --git a/docs/cli/sqoopctl_resolvermap_register.md b/docs/cli/sqoopctl_resolvermap_register.md index 802a01c..8e54519 100644 --- a/docs/cli/sqoopctl_resolvermap_register.md +++ b/docs/cli/sqoopctl_resolvermap_register.md @@ -37,5 +37,5 @@ sqoopctl resolvermap register TypeName FieldName -f resolver.yaml [-s schema-nam ### SEE ALSO -* [sqoopctl resolvermap](../sqoopctl_resolvermap) - +* [sqoopctl resolvermap](../sqoopctl_resolvermap) - interacting with sqoop resolver maps diff --git a/docs/cli/sqoopctl_resolvermap_reset.md b/docs/cli/sqoopctl_resolvermap_reset.md index dda7bfb..422c51a 100644 --- a/docs/cli/sqoopctl_resolvermap_reset.md +++ b/docs/cli/sqoopctl_resolvermap_reset.md @@ -30,5 +30,5 @@ sqoopctl resolvermap reset [NAME] [flags] ### SEE ALSO -* [sqoopctl resolvermap](../sqoopctl_resolvermap) - +* [sqoopctl resolvermap](../sqoopctl_resolvermap) - interacting with sqoop resolver maps diff --git a/docs/cli/sqoopctl_schema.md b/docs/cli/sqoopctl_schema.md index 0c4216b..45c5a86 100644 --- a/docs/cli/sqoopctl_schema.md +++ b/docs/cli/sqoopctl_schema.md @@ -4,11 +4,11 @@ weight: 5 --- ## sqoopctl schema - +interacting with sqoop schema resources ### Synopsis - +interacting with sqoop schema resources ### Options @@ -28,7 +28,8 @@ weight: 5 ### SEE ALSO -* [sqoopctl](../sqoopctl) - Interact with Sqoop's storage API from the command line +* [sqoopctl](../sqoopctl) - Interact with Sqoop's storage API from the command line. +For more information, visit https://sqoop.solo.io. * [sqoopctl schema create](../sqoopctl_schema_create) - upload a schema to Sqoop from a local GraphQL Schema file * [sqoopctl schema delete](../sqoopctl_schema_delete) - delete a schema by its name * [sqoopctl schema update](../sqoopctl_schema_update) - upload a schema to Sqoop from a local GraphQL Schema file diff --git a/docs/cli/sqoopctl_schema_create.md b/docs/cli/sqoopctl_schema_create.md index df0149e..d21a5a2 100644 --- a/docs/cli/sqoopctl_schema_create.md +++ b/docs/cli/sqoopctl_schema_create.md @@ -32,5 +32,5 @@ sqoopctl schema create NAME -f [flags] ### SEE ALSO -* [sqoopctl schema](../sqoopctl_schema) - +* [sqoopctl schema](../sqoopctl_schema) - interacting with sqoop schema resources diff --git a/docs/cli/sqoopctl_schema_delete.md b/docs/cli/sqoopctl_schema_delete.md index ab10e94..c331dd4 100644 --- a/docs/cli/sqoopctl_schema_delete.md +++ b/docs/cli/sqoopctl_schema_delete.md @@ -32,5 +32,5 @@ sqoopctl schema delete [NAME] [flags] ### SEE ALSO -* [sqoopctl schema](../sqoopctl_schema) - +* [sqoopctl schema](../sqoopctl_schema) - interacting with sqoop schema resources diff --git a/docs/cli/sqoopctl_schema_update.md b/docs/cli/sqoopctl_schema_update.md index 8009919..79c2115 100644 --- a/docs/cli/sqoopctl_schema_update.md +++ b/docs/cli/sqoopctl_schema_update.md @@ -32,5 +32,5 @@ sqoopctl schema update NAME -f [flags] ### SEE ALSO -* [sqoopctl schema](../sqoopctl_schema) - +* [sqoopctl schema](../sqoopctl_schema) - interacting with sqoop schema resources diff --git a/docs/cli/sqoopctl_uninstall.md b/docs/cli/sqoopctl_uninstall.md index 12e7546..2fecba1 100644 --- a/docs/cli/sqoopctl_uninstall.md +++ b/docs/cli/sqoopctl_uninstall.md @@ -4,11 +4,11 @@ weight: 5 --- ## sqoopctl uninstall -uninstall gloo +uninstall sqoop and remove namespace (gloo-system by default) ### Synopsis -uninstall gloo +uninstall sqoop and remove namespace (gloo-system by default) ``` sqoopctl uninstall [flags] @@ -17,7 +17,8 @@ sqoopctl uninstall [flags] ### Options ``` - -h, --help help for uninstall + -h, --help help for uninstall + -n, --namespace string which namespace to uninstall sqoop from (default "gloo-system") ``` ### Options inherited from parent commands @@ -30,5 +31,6 @@ sqoopctl uninstall [flags] ### SEE ALSO -* [sqoopctl](../sqoopctl) - Interact with Sqoop's storage API from the command line +* [sqoopctl](../sqoopctl) - Interact with Sqoop's storage API from the command line. +For more information, visit https://sqoop.solo.io. diff --git a/pkg/api/v1/api_snapshot.sk.go b/pkg/api/v1/api_snapshot.sk.go index d268dc4..e4dd283 100644 --- a/pkg/api/v1/api_snapshot.sk.go +++ b/pkg/api/v1/api_snapshot.sk.go @@ -3,6 +3,8 @@ package v1 import ( + "fmt" + "github.com/solo-io/solo-kit/pkg/utils/hashutils" "go.uber.org/zap" ) @@ -41,3 +43,33 @@ func (s ApiSnapshot) HashFields() []zap.Field { return append(fields, zap.Uint64("snapshotHash", s.Hash())) } + +type ApiSnapshotStringer struct { + Version uint64 + ResolverMaps []string + Schemas []string +} + +func (ss ApiSnapshotStringer) String() string { + s := fmt.Sprintf("ApiSnapshot %v\n", ss.Version) + + s += fmt.Sprintf(" ResolverMaps %v\n", len(ss.ResolverMaps)) + for _, name := range ss.ResolverMaps { + s += fmt.Sprintf(" %v\n", name) + } + + s += fmt.Sprintf(" Schemas %v\n", len(ss.Schemas)) + for _, name := range ss.Schemas { + s += fmt.Sprintf(" %v\n", name) + } + + return s +} + +func (s ApiSnapshot) Stringer() ApiSnapshotStringer { + return ApiSnapshotStringer{ + Version: s.Hash(), + ResolverMaps: s.ResolverMaps.List().NamespacesDotNames(), + Schemas: s.Schemas.List().NamespacesDotNames(), + } +} diff --git a/test/testdata/utils.go b/test/testdata/utils.go index 738c35b..c6c58d0 100644 --- a/test/testdata/utils.go +++ b/test/testdata/utils.go @@ -4,7 +4,7 @@ import ( glooV1 "github.com/solo-io/gloo/projects/gloo/pkg/api/v1" "github.com/solo-io/gloo/projects/gloo/pkg/api/v1/plugins/rest" "github.com/solo-io/solo-kit/pkg/api/v1/resources/core" - "github.com/solo-io/sqoop/pkg/api/v1" + v1 "github.com/solo-io/sqoop/pkg/api/v1" "github.com/solo-io/sqoop/pkg/engine/exec" "github.com/solo-io/sqoop/pkg/engine/resolvers" "github.com/solo-io/sqoop/pkg/translator" @@ -16,7 +16,7 @@ const resolversName = "starwars-resolvers" const namespace = "default" var resolverMetadata = core.Metadata{ - Name: resolversName, + Name: resolversName, Namespace: namespace, } @@ -129,7 +129,7 @@ func StarWarsResolverMap() *v1.ResolverMap { func StarWarsV1Schema() *v1.Schema { return &v1.Schema{ - Metadata: resolverMetadata, + Metadata: resolverMetadata, InlineSchema: starWarsSchemaString, } } diff --git a/test/unit/executable_resolvers_test.go b/test/unit/executable_resolvers_test.go index 050d164..721f9ca 100644 --- a/test/unit/executable_resolvers_test.go +++ b/test/unit/executable_resolvers_test.go @@ -1,6 +1,5 @@ package unit_test - import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega"