From a4ad7ddfbb021c0d9e560c749988fc4d85fd5e95 Mon Sep 17 00:00:00 2001 From: stefanprodan Date: Mon, 23 Sep 2019 16:42:50 +0300 Subject: [PATCH] Move Flux packages to pkg dir --- Makefile | 12 +++--- cmd/fluxctl/args.go | 2 +- cmd/fluxctl/automate_cmd.go | 2 +- cmd/fluxctl/await.go | 6 +-- cmd/fluxctl/deautomate_cmd.go | 2 +- cmd/fluxctl/install_cmd.go | 2 +- cmd/fluxctl/list_images_cmd.go | 10 ++--- cmd/fluxctl/list_workloads_cmd.go | 4 +- cmd/fluxctl/lock_cmd.go | 2 +- cmd/fluxctl/main.go | 2 +- cmd/fluxctl/main_test.go | 10 ++--- cmd/fluxctl/policy_cmd.go | 6 +-- cmd/fluxctl/release_cmd.go | 12 +++--- cmd/fluxctl/release_cmd_test.go | 4 +- cmd/fluxctl/root_cmd.go | 6 +-- cmd/fluxctl/sync_cmd.go | 4 +- cmd/fluxctl/unlock_cmd.go | 2 +- cmd/fluxd/main.go | 38 +++++++++---------- .../apis/flux.weave.works/v1beta1/types.go | 2 +- {api => pkg/api}/api.go | 2 +- {api => pkg/api}/v10/api.go | 6 +-- {api => pkg/api}/v11/api.go | 6 +-- {api => pkg/api}/v6/api.go | 12 +++--- {api => pkg/api}/v6/container.go | 8 ++-- {api => pkg/api}/v6/container_test.go | 6 +-- {api => pkg/api}/v9/api.go | 2 +- {api => pkg/api}/v9/change.go | 2 +- {api => pkg/api}/v9/change_test.go | 2 +- {checkpoint => pkg/checkpoint}/checkpoint.go | 0 .../checkpoint}/checkpoint_darwin.go | 0 .../checkpoint}/checkpoint_linux_amd64.go | 0 .../checkpoint}/checkpoint_linux_arm.go | 0 .../checkpoint}/checkpoint_linux_arm64.go | 0 {cluster => pkg/cluster}/cluster.go | 6 +-- .../cluster}/kubernetes/cached_disco.go | 0 .../cluster}/kubernetes/cached_disco_test.go | 0 {cluster => pkg/cluster}/kubernetes/doc.go | 0 {cluster => pkg/cluster}/kubernetes/errors.go | 2 +- {cluster => pkg/cluster}/kubernetes/images.go | 6 +-- .../cluster}/kubernetes/images_test.go | 4 +- .../cluster}/kubernetes/kubernetes.go | 14 +++---- .../cluster}/kubernetes/kubernetes_test.go | 0 .../cluster}/kubernetes/kubeyaml.go | 0 .../cluster}/kubernetes/manifests.go | 6 +-- .../cluster}/kubernetes/manifests_test.go | 2 +- {cluster => pkg/cluster}/kubernetes/mock.go | 2 +- .../cluster}/kubernetes/namespacer.go | 2 +- .../cluster}/kubernetes/namespacer_test.go | 2 +- {cluster => pkg/cluster}/kubernetes/patch.go | 4 +- .../cluster}/kubernetes/patch_test.go | 2 +- .../cluster}/kubernetes/policies.go | 4 +- .../cluster}/kubernetes/policies_test.go | 8 ++-- .../cluster}/kubernetes/resource/cronjob.go | 4 +- .../cluster}/kubernetes/resource/daemonset.go | 4 +- .../kubernetes/resource/deployment.go | 4 +- .../cluster}/kubernetes/resource/doc.go | 0 .../kubernetes/resource/helmrelease.go | 10 ++--- .../kubernetes/resource/helmrelease_test.go | 2 +- .../cluster}/kubernetes/resource/list.go | 0 .../cluster}/kubernetes/resource/load.go | 0 .../cluster}/kubernetes/resource/load_test.go | 4 +- .../cluster}/kubernetes/resource/namespace.go | 0 .../cluster}/kubernetes/resource/resource.go | 6 +-- .../cluster}/kubernetes/resource/spec.go | 6 +-- .../kubernetes/resource/statefulset.go | 4 +- .../cluster}/kubernetes/resourcekinds.go | 10 ++--- .../cluster}/kubernetes/sshkeyring.go | 2 +- {cluster => pkg/cluster}/kubernetes/sync.go | 8 ++-- .../cluster}/kubernetes/sync_test.go | 8 ++-- .../cluster}/kubernetes/testfiles/data.go | 2 +- .../kubernetes/testfiles/data_test.go | 0 {cluster => pkg/cluster}/kubernetes/update.go | 6 +-- .../cluster}/kubernetes/update_test.go | 7 ++-- {cluster => pkg/cluster}/mock/mock.go | 10 ++--- {cluster => pkg/cluster}/sync.go | 2 +- {daemon => pkg/daemon}/daemon.go | 36 +++++++++--------- {daemon => pkg/daemon}/daemon_test.go | 38 +++++++++---------- {daemon => pkg/daemon}/errors.go | 10 ++--- {daemon => pkg/daemon}/images.go | 8 ++-- {daemon => pkg/daemon}/images_test.go | 14 +++---- {daemon => pkg/daemon}/loop.go | 6 +-- {daemon => pkg/daemon}/metrics.go | 2 +- {daemon => pkg/daemon}/note.go | 4 +- {daemon => pkg/daemon}/sync.go | 14 +++---- {daemon => pkg/daemon}/sync_test.go | 24 ++++++------ {errors => pkg/errors}/errors.go | 2 +- {errors => pkg/errors}/errors_test.go | 0 {event => pkg/event}/event.go | 4 +- {event => pkg/event}/event_test.go | 2 +- {git => pkg/git}/errors.go | 2 +- {git => pkg/git}/export.go | 0 {git => pkg/git}/export_test.go | 2 +- {git => pkg/git}/gittest/repo.go | 6 +-- {git => pkg/git}/gittest/repo_test.go | 6 +-- {git => pkg/git}/mirrors.go | 0 {git => pkg/git}/operations.go | 0 {git => pkg/git}/operations_test.go | 2 +- {git => pkg/git}/repo.go | 0 {git => pkg/git}/signature.go | 0 {git => pkg/git}/url.go | 0 {git => pkg/git}/url_test.go | 0 {git => pkg/git}/working.go | 0 {gpg => pkg/gpg}/gpg.go | 0 {gpg => pkg/gpg}/gpgtest/gpg.go | 2 +- {guid => pkg/guid}/guid.go | 0 {http => pkg/http}/accept.go | 0 {http => pkg/http}/accept_test.go | 0 {http => pkg/http}/client/client.go | 20 +++++----- {http => pkg/http}/daemon/server.go | 18 ++++----- {http => pkg/http}/daemon/server_test.go | 2 +- {http => pkg/http}/daemon/upstream.go | 12 +++--- {http => pkg/http}/daemon/upstream_test.go | 0 {http => pkg/http}/errors.go | 10 ++--- {http => pkg/http}/httperror/api_error.go | 0 {http => pkg/http}/routes.go | 0 {http => pkg/http}/transport.go | 2 +- {http => pkg/http}/validate.go | 0 {http => pkg/http}/websocket/client.go | 2 +- {http => pkg/http}/websocket/ping.go | 0 {http => pkg/http}/websocket/server.go | 0 {http => pkg/http}/websocket/websocket.go | 0 .../http}/websocket/websocket_test.go | 2 +- {image => pkg/image}/image.go | 0 {image => pkg/image}/image_test.go | 0 {install => pkg/install}/generate.go | 2 +- .../install}/generated_templates.gogen.go | 0 {install => pkg/install}/install.go | 0 {install => pkg/install}/install_test.go | 0 .../install}/templates/flux-account.yaml.tmpl | 0 .../templates/flux-deployment.yaml.tmpl | 0 .../install}/templates/flux-secret.yaml.tmpl | 0 .../install}/templates/memcache-dep.yaml.tmpl | 0 .../install}/templates/memcache-svc.yaml.tmpl | 0 {job => pkg/job}/job.go | 2 +- {job => pkg/job}/job_test.go | 0 {job => pkg/job}/status_cache.go | 0 {manifests => pkg/manifests}/configaware.go | 4 +- .../manifests}/configaware_test.go | 10 ++--- {manifests => pkg/manifests}/configfile.go | 2 +- .../manifests}/configfile_test.go | 2 +- {manifests => pkg/manifests}/manifests.go | 4 +- {manifests => pkg/manifests}/rawfiles.go | 4 +- {manifests => pkg/manifests}/store.go | 4 +- {metrics => pkg/metrics}/metrics.go | 0 {policy => pkg/policy}/pattern.go | 2 +- {policy => pkg/policy}/pattern_test.go | 0 {policy => pkg/policy}/policy.go | 0 {policy => pkg/policy}/policy_test.go | 0 {registry => pkg/registry}/aws.go | 2 +- {registry => pkg/registry}/azure.go | 0 {registry => pkg/registry}/azure_test.go | 0 {registry => pkg/registry}/cache/cache.go | 2 +- {registry => pkg/registry}/cache/doc.go | 0 .../cache/memcached/integration_test.go | 8 ++-- .../registry}/cache/memcached/memcached.go | 2 +- .../cache/memcached/memcached_test.go | 0 .../registry}/cache/monitoring.go | 2 +- {registry => pkg/registry}/cache/registry.go | 6 +-- .../registry}/cache/registry_test.go | 4 +- .../registry}/cache/repocachemanager.go | 4 +- .../registry}/cache/repocachemanager_test.go | 4 +- {registry => pkg/registry}/cache/warming.go | 4 +- .../registry}/cache/warming_test.go | 6 +-- {registry => pkg/registry}/client.go | 2 +- {registry => pkg/registry}/client_factory.go | 4 +- {registry => pkg/registry}/credentials.go | 0 .../registry}/credentials_test.go | 0 {registry => pkg/registry}/doc.go | 0 {registry => pkg/registry}/gcp.go | 0 {registry => pkg/registry}/imageentry_test.go | 2 +- .../registry}/middleware/rate_limiter.go | 0 {registry => pkg/registry}/mock/mock.go | 4 +- {registry => pkg/registry}/monitoring.go | 4 +- {registry => pkg/registry}/registry.go | 2 +- {release => pkg/release}/context.go | 10 ++--- {release => pkg/release}/errors.go | 4 +- {release => pkg/release}/releaser.go | 4 +- {release => pkg/release}/releaser_test.go | 20 +++++----- {remote => pkg/remote}/doc.go | 0 {remote => pkg/remote}/errors.go | 8 ++-- {remote => pkg/remote}/logging.go | 14 +++---- {remote => pkg/remote}/metrics.go | 16 ++++---- {remote => pkg/remote}/mock.go | 20 +++++----- {remote => pkg/remote}/mock_test.go | 2 +- {remote => pkg/remote}/rpc/baseclient.go | 16 ++++---- {remote => pkg/remote}/rpc/clientV10.go | 6 +-- {remote => pkg/remote}/rpc/clientV11.go | 6 +-- {remote => pkg/remote}/rpc/clientV6.go | 14 +++---- {remote => pkg/remote}/rpc/clientV7.go | 14 +++---- {remote => pkg/remote}/rpc/clientV8.go | 12 +++--- {remote => pkg/remote}/rpc/clientV9.go | 4 +- {remote => pkg/remote}/rpc/compat.go | 18 ++++----- {remote => pkg/remote}/rpc/doc.go | 0 {remote => pkg/remote}/rpc/rpc_test.go | 4 +- {remote => pkg/remote}/rpc/server.go | 14 +++---- {resource => pkg/resource}/id.go | 0 {resource => pkg/resource}/id_test.go | 0 {resource => pkg/resource}/policy.go | 3 +- {resource => pkg/resource}/resource.go | 4 +- {ssh => pkg/ssh}/keygen.go | 0 {ssh => pkg/ssh}/keyring.go | 0 {sync => pkg/sync}/git.go | 2 +- {sync => pkg/sync}/mock.go | 4 +- {sync => pkg/sync}/provider.go | 0 {sync => pkg/sync}/secret.go | 0 {sync => pkg/sync}/sync.go | 4 +- {sync => pkg/sync}/sync_test.go | 12 +++--- {update => pkg/update}/automated.go | 4 +- {update => pkg/update}/filter.go | 6 +-- {update => pkg/update}/images.go | 10 ++--- {update => pkg/update}/images_test.go | 6 +-- {update => pkg/update}/menu.go | 2 +- {update => pkg/update}/menu_unix.go | 0 {update => pkg/update}/menu_win.go | 0 {update => pkg/update}/metrics.go | 2 +- {update => pkg/update}/print.go | 0 {update => pkg/update}/print_test.go | 4 +- {update => pkg/update}/release_containers.go | 4 +- {update => pkg/update}/release_image.go | 8 ++-- {update => pkg/update}/result.go | 4 +- {update => pkg/update}/spec.go | 2 +- {update => pkg/update}/spec_test.go | 0 {update => pkg/update}/sync.go | 0 {update => pkg/update}/workload.go | 4 +- 224 files changed, 489 insertions(+), 489 deletions(-) rename {api => pkg/api}/api.go (84%) rename {api => pkg/api}/v10/api.go (79%) rename {api => pkg/api}/v11/api.go (79%) rename {api => pkg/api}/v6/api.go (90%) rename {api => pkg/api}/v6/container.go (96%) rename {api => pkg/api}/v6/container_test.go (97%) rename {api => pkg/api}/v9/api.go (91%) rename {api => pkg/api}/v9/change.go (96%) rename {api => pkg/api}/v9/change_test.go (94%) rename {checkpoint => pkg/checkpoint}/checkpoint.go (100%) rename {checkpoint => pkg/checkpoint}/checkpoint_darwin.go (100%) rename {checkpoint => pkg/checkpoint}/checkpoint_linux_amd64.go (100%) rename {checkpoint => pkg/checkpoint}/checkpoint_linux_arm.go (100%) rename {checkpoint => pkg/checkpoint}/checkpoint_linux_arm64.go (100%) rename {cluster => pkg/cluster}/cluster.go (96%) rename {cluster => pkg/cluster}/kubernetes/cached_disco.go (100%) rename {cluster => pkg/cluster}/kubernetes/cached_disco_test.go (100%) rename {cluster => pkg/cluster}/kubernetes/doc.go (100%) rename {cluster => pkg/cluster}/kubernetes/errors.go (95%) rename {cluster => pkg/cluster}/kubernetes/images.go (97%) rename {cluster => pkg/cluster}/kubernetes/images_test.go (97%) rename {cluster => pkg/cluster}/kubernetes/kubernetes.go (97%) rename {cluster => pkg/cluster}/kubernetes/kubernetes_test.go (100%) rename {cluster => pkg/cluster}/kubernetes/kubeyaml.go (100%) rename {cluster => pkg/cluster}/kubernetes/manifests.go (98%) rename {cluster => pkg/cluster}/kubernetes/manifests_test.go (98%) rename {cluster => pkg/cluster}/kubernetes/mock.go (71%) rename {cluster => pkg/cluster}/kubernetes/namespacer.go (97%) rename {cluster => pkg/cluster}/kubernetes/namespacer_test.go (97%) rename {cluster => pkg/cluster}/kubernetes/patch.go (98%) rename {cluster => pkg/cluster}/kubernetes/patch_test.go (98%) rename {cluster => pkg/cluster}/kubernetes/policies.go (91%) rename {cluster => pkg/cluster}/kubernetes/policies_test.go (97%) rename {cluster => pkg/cluster}/kubernetes/resource/cronjob.go (87%) rename {cluster => pkg/cluster}/kubernetes/resource/daemonset.go (83%) rename {cluster => pkg/cluster}/kubernetes/resource/deployment.go (85%) rename {cluster => pkg/cluster}/kubernetes/resource/doc.go (100%) rename {cluster => pkg/cluster}/kubernetes/resource/helmrelease.go (98%) rename {cluster => pkg/cluster}/kubernetes/resource/helmrelease_test.go (99%) rename {cluster => pkg/cluster}/kubernetes/resource/list.go (100%) rename {cluster => pkg/cluster}/kubernetes/resource/load.go (100%) rename {cluster => pkg/cluster}/kubernetes/resource/load_test.go (98%) rename {cluster => pkg/cluster}/kubernetes/resource/namespace.go (100%) rename {cluster => pkg/cluster}/kubernetes/resource/resource.go (98%) rename {cluster => pkg/cluster}/kubernetes/resource/spec.go (91%) rename {cluster => pkg/cluster}/kubernetes/resource/statefulset.go (85%) rename {cluster => pkg/cluster}/kubernetes/resourcekinds.go (98%) rename {cluster => pkg/cluster}/kubernetes/sshkeyring.go (99%) rename {cluster => pkg/cluster}/kubernetes/sync.go (98%) rename {cluster => pkg/cluster}/kubernetes/sync_test.go (99%) rename {cluster => pkg/cluster}/kubernetes/testfiles/data.go (99%) rename {cluster => pkg/cluster}/kubernetes/testfiles/data_test.go (100%) rename {cluster => pkg/cluster}/kubernetes/update.go (92%) rename {cluster => pkg/cluster}/kubernetes/update_test.go (99%) rename {cluster => pkg/cluster}/mock/mock.go (94%) rename {cluster => pkg/cluster}/sync.go (96%) rename {daemon => pkg/daemon}/daemon.go (97%) rename {daemon => pkg/daemon}/daemon_test.go (96%) rename {daemon => pkg/daemon}/errors.go (90%) rename {daemon => pkg/daemon}/images.go (96%) rename {daemon => pkg/daemon}/images_test.go (95%) rename {daemon => pkg/daemon}/loop.go (98%) rename {daemon => pkg/daemon}/metrics.go (97%) rename {daemon => pkg/daemon}/note.go (69%) rename {daemon => pkg/daemon}/sync.go (97%) rename {daemon => pkg/daemon}/sync_test.go (94%) rename {errors => pkg/errors}/errors.go (97%) rename {errors => pkg/errors}/errors_test.go (100%) rename {event => pkg/event}/event.go (99%) rename {event => pkg/event}/event_test.go (98%) rename {git => pkg/git}/errors.go (98%) rename {git => pkg/git}/export.go (100%) rename {git => pkg/git}/export_test.go (93%) rename {git => pkg/git}/gittest/repo.go (96%) rename {git => pkg/git}/gittest/repo_test.go (97%) rename {git => pkg/git}/mirrors.go (100%) rename {git => pkg/git}/operations.go (100%) rename {git => pkg/git}/operations_test.go (99%) rename {git => pkg/git}/repo.go (100%) rename {git => pkg/git}/signature.go (100%) rename {git => pkg/git}/url.go (100%) rename {git => pkg/git}/url_test.go (100%) rename {git => pkg/git}/working.go (100%) rename {gpg => pkg/gpg}/gpg.go (100%) rename {gpg => pkg/gpg}/gpgtest/gpg.go (96%) rename {guid => pkg/guid}/guid.go (100%) rename {http => pkg/http}/accept.go (100%) rename {http => pkg/http}/accept_test.go (100%) rename {http => pkg/http}/client/client.go (95%) rename {http => pkg/http}/daemon/server.go (96%) rename {http => pkg/http}/daemon/server_test.go (88%) rename {http => pkg/http}/daemon/upstream.go (94%) rename {http => pkg/http}/daemon/upstream_test.go (100%) rename {http => pkg/http}/errors.go (84%) rename {http => pkg/http}/httperror/api_error.go (100%) rename {http => pkg/http}/routes.go (100%) rename {http => pkg/http}/transport.go (99%) rename {http => pkg/http}/validate.go (100%) rename {http => pkg/http}/websocket/client.go (97%) rename {http => pkg/http}/websocket/ping.go (100%) rename {http => pkg/http}/websocket/server.go (100%) rename {http => pkg/http}/websocket/websocket.go (100%) rename {http => pkg/http}/websocket/websocket_test.go (97%) rename {image => pkg/image}/image.go (100%) rename {image => pkg/image}/image_test.go (100%) rename {install => pkg/install}/generate.go (96%) rename {install => pkg/install}/generated_templates.gogen.go (100%) rename {install => pkg/install}/install.go (100%) rename {install => pkg/install}/install_test.go (100%) rename {install => pkg/install}/templates/flux-account.yaml.tmpl (100%) rename {install => pkg/install}/templates/flux-deployment.yaml.tmpl (100%) rename {install => pkg/install}/templates/flux-secret.yaml.tmpl (100%) rename {install => pkg/install}/templates/memcache-dep.yaml.tmpl (100%) rename {install => pkg/install}/templates/memcache-svc.yaml.tmpl (100%) rename {job => pkg/job}/job.go (99%) rename {job => pkg/job}/job_test.go (100%) rename {job => pkg/job}/status_cache.go (100%) rename {manifests => pkg/manifests}/configaware.go (99%) rename {manifests => pkg/manifests}/configaware_test.go (96%) rename {manifests => pkg/manifests}/configfile.go (99%) rename {manifests => pkg/manifests}/configfile_test.go (99%) rename {manifests => pkg/manifests}/manifests.go (96%) rename {manifests => pkg/manifests}/rawfiles.go (97%) rename {manifests => pkg/manifests}/store.go (93%) rename {metrics => pkg/metrics}/metrics.go (100%) rename {policy => pkg/policy}/pattern.go (98%) rename {policy => pkg/policy}/pattern_test.go (100%) rename {policy => pkg/policy}/policy.go (100%) rename {policy => pkg/policy}/policy_test.go (100%) rename {registry => pkg/registry}/aws.go (99%) rename {registry => pkg/registry}/azure.go (100%) rename {registry => pkg/registry}/azure_test.go (100%) rename {registry => pkg/registry}/cache/cache.go (97%) rename {registry => pkg/registry}/cache/doc.go (100%) rename {registry => pkg/registry}/cache/memcached/integration_test.go (94%) rename {registry => pkg/registry}/cache/memcached/memcached.go (99%) rename {registry => pkg/registry}/cache/memcached/memcached_test.go (100%) rename {registry => pkg/registry}/cache/monitoring.go (96%) rename {registry => pkg/registry}/cache/registry.go (97%) rename {registry => pkg/registry}/cache/registry_test.go (96%) rename {registry => pkg/registry}/cache/repocachemanager.go (99%) rename {registry => pkg/registry}/cache/repocachemanager_test.go (93%) rename {registry => pkg/registry}/cache/warming.go (99%) rename {registry => pkg/registry}/cache/warming_test.go (97%) rename {registry => pkg/registry}/client.go (99%) rename {registry => pkg/registry}/client_factory.go (98%) rename {registry => pkg/registry}/credentials.go (100%) rename {registry => pkg/registry}/credentials_test.go (100%) rename {registry => pkg/registry}/doc.go (100%) rename {registry => pkg/registry}/gcp.go (100%) rename {registry => pkg/registry}/imageentry_test.go (97%) rename {registry => pkg/registry}/middleware/rate_limiter.go (100%) rename {registry => pkg/registry}/mock/mock.go (95%) rename {registry => pkg/registry}/monitoring.go (96%) rename {registry => pkg/registry}/registry.go (92%) rename {release => pkg/release}/context.go (95%) rename {release => pkg/release}/errors.go (86%) rename {release => pkg/release}/releaser.go (98%) rename {release => pkg/release}/releaser_test.go (98%) rename {remote => pkg/remote}/doc.go (100%) rename {remote => pkg/remote}/errors.go (93%) rename {remote => pkg/remote}/logging.go (92%) rename {remote => pkg/remote}/metrics.go (94%) rename {remote => pkg/remote}/mock.go (94%) rename {remote => pkg/remote}/mock_test.go (84%) rename {remote => pkg/remote}/rpc/baseclient.go (88%) rename {remote => pkg/remote}/rpc/clientV10.go (91%) rename {remote => pkg/remote}/rpc/clientV11.go (91%) rename {remote => pkg/remote}/rpc/clientV6.go (95%) rename {remote => pkg/remote}/rpc/clientV7.go (94%) rename {remote => pkg/remote}/rpc/clientV8.go (90%) rename {remote => pkg/remote}/rpc/clientV9.go (89%) rename {remote => pkg/remote}/rpc/compat.go (94%) rename {remote => pkg/remote}/rpc/doc.go (100%) rename {remote => pkg/remote}/rpc/rpc_test.go (95%) rename {remote => pkg/remote}/rpc/server.go (95%) rename {resource => pkg/resource}/id.go (100%) rename {resource => pkg/resource}/id_test.go (100%) rename {resource => pkg/resource}/policy.go (97%) rename {resource => pkg/resource}/resource.go (91%) rename {ssh => pkg/ssh}/keygen.go (100%) rename {ssh => pkg/ssh}/keyring.go (100%) rename {sync => pkg/sync}/git.go (98%) rename {sync => pkg/sync}/mock.go (92%) rename {sync => pkg/sync}/provider.go (100%) rename {sync => pkg/sync}/secret.go (100%) rename {sync => pkg/sync}/sync.go (89%) rename {sync => pkg/sync}/sync_test.go (89%) rename {update => pkg/update}/automated.go (98%) rename {update => pkg/update}/filter.go (95%) rename {update => pkg/update}/images.go (96%) rename {update => pkg/update}/images_test.go (97%) rename {update => pkg/update}/menu.go (99%) rename {update => pkg/update}/menu_unix.go (100%) rename {update => pkg/update}/menu_win.go (100%) rename {update => pkg/update}/metrics.go (96%) rename {update => pkg/update}/print.go (100%) rename {update => pkg/update}/print_test.go (97%) rename {update => pkg/update}/release_containers.go (98%) rename {update => pkg/update}/release_image.go (98%) rename {update => pkg/update}/result.go (96%) rename {update => pkg/update}/spec.go (97%) rename {update => pkg/update}/spec_test.go (100%) rename {update => pkg/update}/sync.go (100%) rename {update => pkg/update}/workload.go (85%) diff --git a/Makefile b/Makefile index d13961095d..056aea03de 100644 --- a/Makefile +++ b/Makefile @@ -113,14 +113,14 @@ $(GOBIN)/fluxd: $(FLUXD_DEPS) integration-test: all test/bin/test-flux -generate-deploy: install/generated_templates.gogen.go - cd deploy && go run ../install/generate.go deploy +generate-deploy: pkg/install/generated_templates.gogen.go + cd deploy && go run ../pkg/install/generate.go deploy -install/generated_templates.gogen.go: install/templates/* - cd install && go run generate.go embedded-templates +pkg/install/generated_templates.gogen.go: pkg/install/templates/* + cd pkg/install && go run generate.go embedded-templates -check-generated: generate-deploy install/generated_templates.gogen.go - git diff --exit-code -- integrations/apis integrations/client install/generated_templates.gogen.go +check-generated: generate-deploy pkg/install/generated_templates.gogen.go + git diff --exit-code -- integrations/apis integrations/client pkg/install/generated_templates.gogen.go build-docs: @cd docs && docker build -t flux-docs . diff --git a/cmd/fluxctl/args.go b/cmd/fluxctl/args.go index 8fe2dfd605..04c69ebb79 100644 --- a/cmd/fluxctl/args.go +++ b/cmd/fluxctl/args.go @@ -11,7 +11,7 @@ import ( "github.com/spf13/cobra" - "github.com/fluxcd/flux/update" + "github.com/fluxcd/flux/pkg/update" ) func AddCauseFlags(cmd *cobra.Command, opts *update.Cause) { diff --git a/cmd/fluxctl/automate_cmd.go b/cmd/fluxctl/automate_cmd.go index b6d2cfbefe..fd3a96482a 100644 --- a/cmd/fluxctl/automate_cmd.go +++ b/cmd/fluxctl/automate_cmd.go @@ -3,7 +3,7 @@ package main import ( "github.com/spf13/cobra" - "github.com/fluxcd/flux/update" + "github.com/fluxcd/flux/pkg/update" ) type workloadAutomateOpts struct { diff --git a/cmd/fluxctl/await.go b/cmd/fluxctl/await.go index 63925c4e77..1581bd5388 100644 --- a/cmd/fluxctl/await.go +++ b/cmd/fluxctl/await.go @@ -7,9 +7,9 @@ import ( "io" "time" - "github.com/fluxcd/flux/api" - "github.com/fluxcd/flux/job" - "github.com/fluxcd/flux/update" + "github.com/fluxcd/flux/pkg/api" + "github.com/fluxcd/flux/pkg/job" + "github.com/fluxcd/flux/pkg/update" ) var ErrTimeout = errors.New("timeout") diff --git a/cmd/fluxctl/deautomate_cmd.go b/cmd/fluxctl/deautomate_cmd.go index bae54d5a8c..30d4787328 100644 --- a/cmd/fluxctl/deautomate_cmd.go +++ b/cmd/fluxctl/deautomate_cmd.go @@ -3,7 +3,7 @@ package main import ( "github.com/spf13/cobra" - "github.com/fluxcd/flux/update" + "github.com/fluxcd/flux/pkg/update" ) type workloadDeautomateOpts struct { diff --git a/cmd/fluxctl/install_cmd.go b/cmd/fluxctl/install_cmd.go index 538912b7c2..f271f1faaa 100644 --- a/cmd/fluxctl/install_cmd.go +++ b/cmd/fluxctl/install_cmd.go @@ -6,7 +6,7 @@ import ( "github.com/spf13/cobra" - "github.com/fluxcd/flux/install" + "github.com/fluxcd/flux/pkg/install" ) type installOpts install.TemplateParameters diff --git a/cmd/fluxctl/list_images_cmd.go b/cmd/fluxctl/list_images_cmd.go index afcec25225..b2ece42517 100644 --- a/cmd/fluxctl/list_images_cmd.go +++ b/cmd/fluxctl/list_images_cmd.go @@ -8,11 +8,11 @@ import ( "github.com/spf13/cobra" - "github.com/fluxcd/flux/api/v10" - "github.com/fluxcd/flux/api/v6" - "github.com/fluxcd/flux/registry" - "github.com/fluxcd/flux/resource" - "github.com/fluxcd/flux/update" + "github.com/fluxcd/flux/pkg/api/v10" + "github.com/fluxcd/flux/pkg/api/v6" + "github.com/fluxcd/flux/pkg/registry" + "github.com/fluxcd/flux/pkg/resource" + "github.com/fluxcd/flux/pkg/update" ) type imageListOpts struct { diff --git a/cmd/fluxctl/list_workloads_cmd.go b/cmd/fluxctl/list_workloads_cmd.go index 53d30a09d5..0fe7e176bb 100644 --- a/cmd/fluxctl/list_workloads_cmd.go +++ b/cmd/fluxctl/list_workloads_cmd.go @@ -8,8 +8,8 @@ import ( "github.com/spf13/cobra" - "github.com/fluxcd/flux/api/v6" - "github.com/fluxcd/flux/policy" + "github.com/fluxcd/flux/pkg/api/v6" + "github.com/fluxcd/flux/pkg/policy" ) type workloadListOpts struct { diff --git a/cmd/fluxctl/lock_cmd.go b/cmd/fluxctl/lock_cmd.go index 699c2d5ff0..873fffe86f 100644 --- a/cmd/fluxctl/lock_cmd.go +++ b/cmd/fluxctl/lock_cmd.go @@ -3,7 +3,7 @@ package main import ( "github.com/spf13/cobra" - "github.com/fluxcd/flux/update" + "github.com/fluxcd/flux/pkg/update" ) type workloadLockOpts struct { diff --git a/cmd/fluxctl/main.go b/cmd/fluxctl/main.go index 154505ad46..b87e8799a8 100644 --- a/cmd/fluxctl/main.go +++ b/cmd/fluxctl/main.go @@ -5,7 +5,7 @@ import ( "github.com/pkg/errors" - fluxerr "github.com/fluxcd/flux/errors" + fluxerr "github.com/fluxcd/flux/pkg/errors" ) func run(args []string) int { diff --git a/cmd/fluxctl/main_test.go b/cmd/fluxctl/main_test.go index e620c775a1..51d5c46378 100644 --- a/cmd/fluxctl/main_test.go +++ b/cmd/fluxctl/main_test.go @@ -11,11 +11,11 @@ import ( "testing" "time" + "github.com/fluxcd/flux/pkg/http/client" "github.com/gorilla/mux" - "github.com/fluxcd/flux/http/client" - transport "github.com/fluxcd/flux/http" - "github.com/fluxcd/flux/job" + transport "github.com/fluxcd/flux/pkg/http" + "github.com/fluxcd/flux/pkg/job" ) func mockServiceOpts(trip *genericMockRoundTripper) *rootOpts { @@ -24,8 +24,8 @@ func mockServiceOpts(trip *genericMockRoundTripper) *rootOpts { } mockAPI := client.New(&c, transport.NewAPIRouter(), "", "") return &rootOpts{ - API: mockAPI, - Timeout: 10*time.Second, + API: mockAPI, + Timeout: 10 * time.Second, } } diff --git a/cmd/fluxctl/policy_cmd.go b/cmd/fluxctl/policy_cmd.go index 17ab1839cf..66d10443d0 100644 --- a/cmd/fluxctl/policy_cmd.go +++ b/cmd/fluxctl/policy_cmd.go @@ -7,9 +7,9 @@ import ( "github.com/spf13/cobra" - "github.com/fluxcd/flux/policy" - "github.com/fluxcd/flux/resource" - "github.com/fluxcd/flux/update" + "github.com/fluxcd/flux/pkg/policy" + "github.com/fluxcd/flux/pkg/resource" + "github.com/fluxcd/flux/pkg/update" ) type workloadPolicyOpts struct { diff --git a/cmd/fluxctl/release_cmd.go b/cmd/fluxctl/release_cmd.go index 6927d2faa0..5c8e01eaa8 100644 --- a/cmd/fluxctl/release_cmd.go +++ b/cmd/fluxctl/release_cmd.go @@ -8,12 +8,12 @@ import ( "github.com/spf13/cobra" - "github.com/fluxcd/flux/api/v11" - "github.com/fluxcd/flux/api/v6" - "github.com/fluxcd/flux/cluster" - "github.com/fluxcd/flux/job" - "github.com/fluxcd/flux/resource" - "github.com/fluxcd/flux/update" + "github.com/fluxcd/flux/pkg/api/v11" + "github.com/fluxcd/flux/pkg/api/v6" + "github.com/fluxcd/flux/pkg/cluster" + "github.com/fluxcd/flux/pkg/job" + "github.com/fluxcd/flux/pkg/resource" + "github.com/fluxcd/flux/pkg/update" ) type workloadReleaseOpts struct { diff --git a/cmd/fluxctl/release_cmd_test.go b/cmd/fluxctl/release_cmd_test.go index 10c8d34a33..7dd1c27009 100644 --- a/cmd/fluxctl/release_cmd_test.go +++ b/cmd/fluxctl/release_cmd_test.go @@ -5,8 +5,8 @@ import ( "reflect" "testing" - "github.com/fluxcd/flux/resource" - "github.com/fluxcd/flux/update" + "github.com/fluxcd/flux/pkg/resource" + "github.com/fluxcd/flux/pkg/update" ) func TestReleaseCommand_CLIConversion(t *testing.T) { diff --git a/cmd/fluxctl/root_cmd.go b/cmd/fluxctl/root_cmd.go index 225facbe6c..11490eff87 100644 --- a/cmd/fluxctl/root_cmd.go +++ b/cmd/fluxctl/root_cmd.go @@ -12,9 +12,9 @@ import ( "github.com/spf13/cobra" "github.com/spf13/pflag" - "github.com/fluxcd/flux/api" - transport "github.com/fluxcd/flux/http" - "github.com/fluxcd/flux/http/client" + "github.com/fluxcd/flux/pkg/api" + transport "github.com/fluxcd/flux/pkg/http" + "github.com/fluxcd/flux/pkg/http/client" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/cmd/fluxctl/sync_cmd.go b/cmd/fluxctl/sync_cmd.go index 5728df3008..c3d3880f65 100644 --- a/cmd/fluxctl/sync_cmd.go +++ b/cmd/fluxctl/sync_cmd.go @@ -7,8 +7,8 @@ import ( "github.com/spf13/cobra" - "github.com/fluxcd/flux/git" - "github.com/fluxcd/flux/update" + "github.com/fluxcd/flux/pkg/git" + "github.com/fluxcd/flux/pkg/update" ) type syncOpts struct { diff --git a/cmd/fluxctl/unlock_cmd.go b/cmd/fluxctl/unlock_cmd.go index 7c24cad91e..1c4393949c 100644 --- a/cmd/fluxctl/unlock_cmd.go +++ b/cmd/fluxctl/unlock_cmd.go @@ -3,7 +3,7 @@ package main import ( "github.com/spf13/cobra" - "github.com/fluxcd/flux/update" + "github.com/fluxcd/flux/pkg/update" ) type workloadUnlockOpts struct { diff --git a/cmd/fluxd/main.go b/cmd/fluxd/main.go index a992bf0a1d..9fdea0e30c 100644 --- a/cmd/fluxd/main.go +++ b/cmd/fluxd/main.go @@ -30,26 +30,26 @@ import ( "k8s.io/client-go/tools/clientcmd" "k8s.io/klog" - "github.com/fluxcd/flux/checkpoint" - "github.com/fluxcd/flux/cluster" - "github.com/fluxcd/flux/cluster/kubernetes" - "github.com/fluxcd/flux/daemon" - "github.com/fluxcd/flux/git" - "github.com/fluxcd/flux/gpg" - transport "github.com/fluxcd/flux/http" - "github.com/fluxcd/flux/http/client" - daemonhttp "github.com/fluxcd/flux/http/daemon" - "github.com/fluxcd/flux/image" hrclient "github.com/fluxcd/flux/integrations/client/clientset/versioned" - "github.com/fluxcd/flux/job" - "github.com/fluxcd/flux/manifests" - "github.com/fluxcd/flux/registry" - "github.com/fluxcd/flux/registry/cache" - registryMemcache "github.com/fluxcd/flux/registry/cache/memcached" - registryMiddleware "github.com/fluxcd/flux/registry/middleware" - "github.com/fluxcd/flux/remote" - "github.com/fluxcd/flux/ssh" - fluxsync "github.com/fluxcd/flux/sync" + "github.com/fluxcd/flux/pkg/checkpoint" + "github.com/fluxcd/flux/pkg/cluster" + "github.com/fluxcd/flux/pkg/cluster/kubernetes" + "github.com/fluxcd/flux/pkg/daemon" + "github.com/fluxcd/flux/pkg/git" + "github.com/fluxcd/flux/pkg/gpg" + transport "github.com/fluxcd/flux/pkg/http" + "github.com/fluxcd/flux/pkg/http/client" + daemonhttp "github.com/fluxcd/flux/pkg/http/daemon" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/job" + "github.com/fluxcd/flux/pkg/manifests" + "github.com/fluxcd/flux/pkg/registry" + "github.com/fluxcd/flux/pkg/registry/cache" + registryMemcache "github.com/fluxcd/flux/pkg/registry/cache/memcached" + registryMiddleware "github.com/fluxcd/flux/pkg/registry/middleware" + "github.com/fluxcd/flux/pkg/remote" + "github.com/fluxcd/flux/pkg/ssh" + fluxsync "github.com/fluxcd/flux/pkg/sync" ) var version = "unversioned" diff --git a/integrations/apis/flux.weave.works/v1beta1/types.go b/integrations/apis/flux.weave.works/v1beta1/types.go index c9e789d77c..e88e3b5450 100644 --- a/integrations/apis/flux.weave.works/v1beta1/types.go +++ b/integrations/apis/flux.weave.works/v1beta1/types.go @@ -9,7 +9,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/helm/pkg/chartutil" - "github.com/fluxcd/flux/resource" + "github.com/fluxcd/flux/pkg/resource" ) // +genclient diff --git a/api/api.go b/pkg/api/api.go similarity index 84% rename from api/api.go rename to pkg/api/api.go index aaeeea366c..41429368e4 100644 --- a/api/api.go +++ b/pkg/api/api.go @@ -1,6 +1,6 @@ package api -import "github.com/fluxcd/flux/api/v11" +import "github.com/fluxcd/flux/pkg/api/v11" // Server defines the minimal interface a Flux must satisfy to adequately serve a // connecting fluxctl. This interface specifically does not facilitate connecting diff --git a/api/v10/api.go b/pkg/api/v10/api.go similarity index 79% rename from api/v10/api.go rename to pkg/api/v10/api.go index 1930e0984d..864378cf91 100644 --- a/api/v10/api.go +++ b/pkg/api/v10/api.go @@ -4,9 +4,9 @@ package v10 import ( "context" - "github.com/fluxcd/flux/api/v6" - "github.com/fluxcd/flux/api/v9" - "github.com/fluxcd/flux/update" + "github.com/fluxcd/flux/pkg/api/v6" + "github.com/fluxcd/flux/pkg/api/v9" + "github.com/fluxcd/flux/pkg/update" ) type ListImagesOptions struct { diff --git a/api/v11/api.go b/pkg/api/v11/api.go similarity index 79% rename from api/v11/api.go rename to pkg/api/v11/api.go index 5da46545cc..846dd705b8 100644 --- a/api/v11/api.go +++ b/pkg/api/v11/api.go @@ -4,9 +4,9 @@ package v11 import ( "context" - "github.com/fluxcd/flux/api/v10" - "github.com/fluxcd/flux/api/v6" - "github.com/fluxcd/flux/resource" + "github.com/fluxcd/flux/pkg/api/v10" + "github.com/fluxcd/flux/pkg/api/v6" + "github.com/fluxcd/flux/pkg/resource" ) type ListServicesOptions struct { diff --git a/api/v6/api.go b/pkg/api/v6/api.go similarity index 90% rename from api/v6/api.go rename to pkg/api/v6/api.go index 01c0311fa3..bf4662bf47 100644 --- a/api/v6/api.go +++ b/pkg/api/v6/api.go @@ -3,12 +3,12 @@ package v6 import ( "context" - "github.com/fluxcd/flux/cluster" - "github.com/fluxcd/flux/git" - "github.com/fluxcd/flux/job" - "github.com/fluxcd/flux/resource" - "github.com/fluxcd/flux/ssh" - "github.com/fluxcd/flux/update" + "github.com/fluxcd/flux/pkg/cluster" + "github.com/fluxcd/flux/pkg/git" + "github.com/fluxcd/flux/pkg/job" + "github.com/fluxcd/flux/pkg/resource" + "github.com/fluxcd/flux/pkg/ssh" + "github.com/fluxcd/flux/pkg/update" ) type ImageStatus struct { diff --git a/api/v6/container.go b/pkg/api/v6/container.go similarity index 96% rename from api/v6/container.go rename to pkg/api/v6/container.go index 7902e2b239..fb578833da 100644 --- a/api/v6/container.go +++ b/pkg/api/v6/container.go @@ -1,11 +1,11 @@ package v6 import ( + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/policy" + "github.com/fluxcd/flux/pkg/registry" + "github.com/fluxcd/flux/pkg/update" "github.com/pkg/errors" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/policy" - "github.com/fluxcd/flux/registry" - "github.com/fluxcd/flux/update" ) // Container describes an individual container including current image info and diff --git a/api/v6/container_test.go b/pkg/api/v6/container_test.go similarity index 97% rename from api/v6/container_test.go rename to pkg/api/v6/container_test.go index 48c1d9cf3d..932dd50aa2 100644 --- a/api/v6/container_test.go +++ b/pkg/api/v6/container_test.go @@ -5,9 +5,9 @@ import ( "github.com/stretchr/testify/assert" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/policy" - "github.com/fluxcd/flux/update" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/policy" + "github.com/fluxcd/flux/pkg/update" ) type justSlice []image.Info diff --git a/api/v9/api.go b/pkg/api/v9/api.go similarity index 91% rename from api/v9/api.go rename to pkg/api/v9/api.go index d9e62fb3c4..51dca06465 100644 --- a/api/v9/api.go +++ b/pkg/api/v9/api.go @@ -4,7 +4,7 @@ package v9 import ( "context" - "github.com/fluxcd/flux/api/v6" + "github.com/fluxcd/flux/pkg/api/v6" ) type Server interface { diff --git a/api/v9/change.go b/pkg/api/v9/change.go similarity index 96% rename from api/v9/change.go rename to pkg/api/v9/change.go index 279a0dbf76..8cf8e9dd61 100644 --- a/api/v9/change.go +++ b/pkg/api/v9/change.go @@ -4,7 +4,7 @@ import ( "encoding/json" "errors" - "github.com/fluxcd/flux/image" + "github.com/fluxcd/flux/pkg/image" ) type ChangeKind string diff --git a/api/v9/change_test.go b/pkg/api/v9/change_test.go similarity index 94% rename from api/v9/change_test.go rename to pkg/api/v9/change_test.go index 5c9acc6a56..c378df47fc 100644 --- a/api/v9/change_test.go +++ b/pkg/api/v9/change_test.go @@ -5,7 +5,7 @@ import ( "reflect" "testing" - "github.com/fluxcd/flux/image" + "github.com/fluxcd/flux/pkg/image" ) func TestChangeEncoding(t *testing.T) { diff --git a/checkpoint/checkpoint.go b/pkg/checkpoint/checkpoint.go similarity index 100% rename from checkpoint/checkpoint.go rename to pkg/checkpoint/checkpoint.go diff --git a/checkpoint/checkpoint_darwin.go b/pkg/checkpoint/checkpoint_darwin.go similarity index 100% rename from checkpoint/checkpoint_darwin.go rename to pkg/checkpoint/checkpoint_darwin.go diff --git a/checkpoint/checkpoint_linux_amd64.go b/pkg/checkpoint/checkpoint_linux_amd64.go similarity index 100% rename from checkpoint/checkpoint_linux_amd64.go rename to pkg/checkpoint/checkpoint_linux_amd64.go diff --git a/checkpoint/checkpoint_linux_arm.go b/pkg/checkpoint/checkpoint_linux_arm.go similarity index 100% rename from checkpoint/checkpoint_linux_arm.go rename to pkg/checkpoint/checkpoint_linux_arm.go diff --git a/checkpoint/checkpoint_linux_arm64.go b/pkg/checkpoint/checkpoint_linux_arm64.go similarity index 100% rename from checkpoint/checkpoint_linux_arm64.go rename to pkg/checkpoint/checkpoint_linux_arm64.go diff --git a/cluster/cluster.go b/pkg/cluster/cluster.go similarity index 96% rename from cluster/cluster.go rename to pkg/cluster/cluster.go index 73a0b647a0..1525f4d990 100644 --- a/cluster/cluster.go +++ b/pkg/cluster/cluster.go @@ -4,9 +4,9 @@ import ( "context" "errors" - "github.com/fluxcd/flux/policy" - "github.com/fluxcd/flux/resource" - "github.com/fluxcd/flux/ssh" + "github.com/fluxcd/flux/pkg/policy" + "github.com/fluxcd/flux/pkg/resource" + "github.com/fluxcd/flux/pkg/ssh" ) // Constants for workload ready status. These are defined here so that diff --git a/cluster/kubernetes/cached_disco.go b/pkg/cluster/kubernetes/cached_disco.go similarity index 100% rename from cluster/kubernetes/cached_disco.go rename to pkg/cluster/kubernetes/cached_disco.go diff --git a/cluster/kubernetes/cached_disco_test.go b/pkg/cluster/kubernetes/cached_disco_test.go similarity index 100% rename from cluster/kubernetes/cached_disco_test.go rename to pkg/cluster/kubernetes/cached_disco_test.go diff --git a/cluster/kubernetes/doc.go b/pkg/cluster/kubernetes/doc.go similarity index 100% rename from cluster/kubernetes/doc.go rename to pkg/cluster/kubernetes/doc.go diff --git a/cluster/kubernetes/errors.go b/pkg/cluster/kubernetes/errors.go similarity index 95% rename from cluster/kubernetes/errors.go rename to pkg/cluster/kubernetes/errors.go index 7443760518..347dfd1ab8 100644 --- a/cluster/kubernetes/errors.go +++ b/pkg/cluster/kubernetes/errors.go @@ -3,7 +3,7 @@ package kubernetes import ( "fmt" - fluxerr "github.com/fluxcd/flux/errors" + fluxerr "github.com/fluxcd/flux/pkg/errors" ) func ObjectMissingError(obj string, err error) *fluxerr.Error { diff --git a/cluster/kubernetes/images.go b/pkg/cluster/kubernetes/images.go similarity index 97% rename from cluster/kubernetes/images.go rename to pkg/cluster/kubernetes/images.go index 6a95d5cb0f..44db1c3cd8 100644 --- a/cluster/kubernetes/images.go +++ b/pkg/cluster/kubernetes/images.go @@ -11,9 +11,9 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/registry" - "github.com/fluxcd/flux/resource" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/registry" + "github.com/fluxcd/flux/pkg/resource" ) func mergeCredentials(log func(...interface{}) error, diff --git a/cluster/kubernetes/images_test.go b/pkg/cluster/kubernetes/images_test.go similarity index 97% rename from cluster/kubernetes/images_test.go rename to pkg/cluster/kubernetes/images_test.go index 5cf93cfa8d..018734f07c 100644 --- a/cluster/kubernetes/images_test.go +++ b/pkg/cluster/kubernetes/images_test.go @@ -9,8 +9,8 @@ import ( apiv1 "k8s.io/api/core/v1" "k8s.io/client-go/kubernetes/fake" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/registry" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/registry" ) func noopLog(...interface{}) error { diff --git a/cluster/kubernetes/kubernetes.go b/pkg/cluster/kubernetes/kubernetes.go similarity index 97% rename from cluster/kubernetes/kubernetes.go rename to pkg/cluster/kubernetes/kubernetes.go index 3a1222d467..2df97da593 100644 --- a/cluster/kubernetes/kubernetes.go +++ b/pkg/cluster/kubernetes/kubernetes.go @@ -18,11 +18,11 @@ import ( k8sclientdynamic "k8s.io/client-go/dynamic" k8sclient "k8s.io/client-go/kubernetes" - "github.com/fluxcd/flux/cluster" - kresource "github.com/fluxcd/flux/cluster/kubernetes/resource" fhrclient "github.com/fluxcd/flux/integrations/client/clientset/versioned" - "github.com/fluxcd/flux/resource" - "github.com/fluxcd/flux/ssh" + "github.com/fluxcd/flux/pkg/cluster" + kresource "github.com/fluxcd/flux/pkg/cluster/kubernetes/resource" + "github.com/fluxcd/flux/pkg/resource" + "github.com/fluxcd/flux/pkg/ssh" ) type coreClient k8sclient.Interface @@ -43,9 +43,9 @@ func MakeClusterClientset(core coreClient, dyn dynamicClient, fluxhelm fluxHelmC helmop helmOperatorClient, disco discoveryClient) ExtendedClient { return ExtendedClient{ - coreClient: core, - dynamicClient: dyn, - fluxHelmClient: fluxhelm, + coreClient: core, + dynamicClient: dyn, + fluxHelmClient: fluxhelm, helmOperatorClient: helmop, discoveryClient: disco, } diff --git a/cluster/kubernetes/kubernetes_test.go b/pkg/cluster/kubernetes/kubernetes_test.go similarity index 100% rename from cluster/kubernetes/kubernetes_test.go rename to pkg/cluster/kubernetes/kubernetes_test.go diff --git a/cluster/kubernetes/kubeyaml.go b/pkg/cluster/kubernetes/kubeyaml.go similarity index 100% rename from cluster/kubernetes/kubeyaml.go rename to pkg/cluster/kubernetes/kubeyaml.go diff --git a/cluster/kubernetes/manifests.go b/pkg/cluster/kubernetes/manifests.go similarity index 98% rename from cluster/kubernetes/manifests.go rename to pkg/cluster/kubernetes/manifests.go index 1f72b26a16..2c333b116c 100644 --- a/cluster/kubernetes/manifests.go +++ b/pkg/cluster/kubernetes/manifests.go @@ -10,9 +10,9 @@ import ( "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" "k8s.io/apimachinery/pkg/runtime/schema" - kresource "github.com/fluxcd/flux/cluster/kubernetes/resource" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/resource" + kresource "github.com/fluxcd/flux/pkg/cluster/kubernetes/resource" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/resource" ) // ResourceScopes maps resource definitions (GroupVersionKind) to whether they are namespaced or not diff --git a/cluster/kubernetes/manifests_test.go b/pkg/cluster/kubernetes/manifests_test.go similarity index 98% rename from cluster/kubernetes/manifests_test.go rename to pkg/cluster/kubernetes/manifests_test.go index 35457b15a8..43c2a8e730 100644 --- a/cluster/kubernetes/manifests_test.go +++ b/pkg/cluster/kubernetes/manifests_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/assert" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/fluxcd/flux/cluster/kubernetes/testfiles" + "github.com/fluxcd/flux/pkg/cluster/kubernetes/testfiles" ) func TestLocalCRDScope(t *testing.T) { diff --git a/cluster/kubernetes/mock.go b/pkg/cluster/kubernetes/mock.go similarity index 71% rename from cluster/kubernetes/mock.go rename to pkg/cluster/kubernetes/mock.go index cf9097fe73..7e0ee475b8 100644 --- a/cluster/kubernetes/mock.go +++ b/pkg/cluster/kubernetes/mock.go @@ -1,6 +1,6 @@ package kubernetes -import kresource "github.com/fluxcd/flux/cluster/kubernetes/resource" +import kresource "github.com/fluxcd/flux/pkg/cluster/kubernetes/resource" type ConstNamespacer string diff --git a/cluster/kubernetes/namespacer.go b/pkg/cluster/kubernetes/namespacer.go similarity index 97% rename from cluster/kubernetes/namespacer.go rename to pkg/cluster/kubernetes/namespacer.go index 2c68e14e7f..db2c3ecc86 100644 --- a/cluster/kubernetes/namespacer.go +++ b/pkg/cluster/kubernetes/namespacer.go @@ -8,7 +8,7 @@ import ( "k8s.io/client-go/discovery" "k8s.io/client-go/tools/clientcmd" - kresource "github.com/fluxcd/flux/cluster/kubernetes/resource" + kresource "github.com/fluxcd/flux/pkg/cluster/kubernetes/resource" ) // The namespace to presume if something doesn't have one, and we diff --git a/cluster/kubernetes/namespacer_test.go b/pkg/cluster/kubernetes/namespacer_test.go similarity index 97% rename from cluster/kubernetes/namespacer_test.go rename to pkg/cluster/kubernetes/namespacer_test.go index a2ddd80223..6286134202 100644 --- a/cluster/kubernetes/namespacer_test.go +++ b/pkg/cluster/kubernetes/namespacer_test.go @@ -8,7 +8,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" corefake "k8s.io/client-go/kubernetes/fake" - kresource "github.com/fluxcd/flux/cluster/kubernetes/resource" + kresource "github.com/fluxcd/flux/pkg/cluster/kubernetes/resource" ) var getAndList = metav1.Verbs([]string{"get", "list"}) diff --git a/cluster/kubernetes/patch.go b/pkg/cluster/kubernetes/patch.go similarity index 98% rename from cluster/kubernetes/patch.go rename to pkg/cluster/kubernetes/patch.go index b9ae5c6716..94f215dc77 100644 --- a/cluster/kubernetes/patch.go +++ b/pkg/cluster/kubernetes/patch.go @@ -15,8 +15,8 @@ import ( "k8s.io/apimachinery/pkg/util/strategicpatch" k8sscheme "k8s.io/client-go/kubernetes/scheme" - kresource "github.com/fluxcd/flux/cluster/kubernetes/resource" - "github.com/fluxcd/flux/resource" + kresource "github.com/fluxcd/flux/pkg/cluster/kubernetes/resource" + "github.com/fluxcd/flux/pkg/resource" ) func createManifestPatch(originalManifests, modifiedManifests []byte, originalSource, modifiedSource string) ([]byte, error) { diff --git a/cluster/kubernetes/patch_test.go b/pkg/cluster/kubernetes/patch_test.go similarity index 98% rename from cluster/kubernetes/patch_test.go rename to pkg/cluster/kubernetes/patch_test.go index 2894e6dd6f..7ff8e28643 100644 --- a/cluster/kubernetes/patch_test.go +++ b/pkg/cluster/kubernetes/patch_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" "gopkg.in/yaml.v2" - "github.com/fluxcd/flux/cluster/kubernetes/resource" + "github.com/fluxcd/flux/pkg/cluster/kubernetes/resource" ) func TestPatchAndApply(t *testing.T) { diff --git a/cluster/kubernetes/policies.go b/pkg/cluster/kubernetes/policies.go similarity index 91% rename from cluster/kubernetes/policies.go rename to pkg/cluster/kubernetes/policies.go index a7b2fb275e..ed5db75afe 100644 --- a/cluster/kubernetes/policies.go +++ b/pkg/cluster/kubernetes/policies.go @@ -3,8 +3,8 @@ package kubernetes import ( "fmt" - kresource "github.com/fluxcd/flux/cluster/kubernetes/resource" - "github.com/fluxcd/flux/resource" + kresource "github.com/fluxcd/flux/pkg/cluster/kubernetes/resource" + "github.com/fluxcd/flux/pkg/resource" ) func (m *manifests) UpdateWorkloadPolicies(def []byte, id resource.ID, update resource.PolicyUpdate) ([]byte, error) { diff --git a/cluster/kubernetes/policies_test.go b/pkg/cluster/kubernetes/policies_test.go similarity index 97% rename from cluster/kubernetes/policies_test.go rename to pkg/cluster/kubernetes/policies_test.go index 503b20e999..0c62191165 100644 --- a/cluster/kubernetes/policies_test.go +++ b/pkg/cluster/kubernetes/policies_test.go @@ -9,8 +9,8 @@ import ( "github.com/go-kit/kit/log" "github.com/stretchr/testify/assert" - "github.com/fluxcd/flux/policy" - "github.com/fluxcd/flux/resource" + "github.com/fluxcd/flux/pkg/policy" + "github.com/fluxcd/flux/pkg/resource" ) func TestUpdatePolicies(t *testing.T) { @@ -170,8 +170,8 @@ func TestUpdatePolicies(t *testing.T) { }, { name: "add tag policy with alternative prefix does not change existing prefix", - in: []string{"filter.fluxcd.io/nginx", "glob:*"}, - out: []string{"filter.fluxcd.io/nginx", "glob:*"}, + in: []string{"filter.fluxcd.io/nginx", "glob:*"}, + out: []string{"filter.fluxcd.io/nginx", "glob:*"}, update: resource.PolicyUpdate{ Add: policy.Set{policy.TagPrefix("nginx"): "glob:*"}, }, diff --git a/cluster/kubernetes/resource/cronjob.go b/pkg/cluster/kubernetes/resource/cronjob.go similarity index 87% rename from cluster/kubernetes/resource/cronjob.go rename to pkg/cluster/kubernetes/resource/cronjob.go index d9c23026cb..5e80bf3ceb 100644 --- a/cluster/kubernetes/resource/cronjob.go +++ b/pkg/cluster/kubernetes/resource/cronjob.go @@ -1,8 +1,8 @@ package resource import ( - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/resource" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/resource" ) type CronJob struct { diff --git a/cluster/kubernetes/resource/daemonset.go b/pkg/cluster/kubernetes/resource/daemonset.go similarity index 83% rename from cluster/kubernetes/resource/daemonset.go rename to pkg/cluster/kubernetes/resource/daemonset.go index 4e27b14852..ba76a2e6bf 100644 --- a/cluster/kubernetes/resource/daemonset.go +++ b/pkg/cluster/kubernetes/resource/daemonset.go @@ -1,8 +1,8 @@ package resource import ( - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/resource" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/resource" ) type DaemonSet struct { diff --git a/cluster/kubernetes/resource/deployment.go b/pkg/cluster/kubernetes/resource/deployment.go similarity index 85% rename from cluster/kubernetes/resource/deployment.go rename to pkg/cluster/kubernetes/resource/deployment.go index 29cff33bc9..79f92a7536 100644 --- a/cluster/kubernetes/resource/deployment.go +++ b/pkg/cluster/kubernetes/resource/deployment.go @@ -1,8 +1,8 @@ package resource import ( - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/resource" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/resource" ) type Deployment struct { diff --git a/cluster/kubernetes/resource/doc.go b/pkg/cluster/kubernetes/resource/doc.go similarity index 100% rename from cluster/kubernetes/resource/doc.go rename to pkg/cluster/kubernetes/resource/doc.go diff --git a/cluster/kubernetes/resource/helmrelease.go b/pkg/cluster/kubernetes/resource/helmrelease.go similarity index 98% rename from cluster/kubernetes/resource/helmrelease.go rename to pkg/cluster/kubernetes/resource/helmrelease.go index 403f18614f..4da61104f1 100644 --- a/cluster/kubernetes/resource/helmrelease.go +++ b/pkg/cluster/kubernetes/resource/helmrelease.go @@ -6,8 +6,8 @@ import ( "sort" "strings" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/resource" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/resource" ) const ( @@ -21,20 +21,20 @@ const ( // image: some/image:version // // The name refers to the source of the image value. - ReleaseContainerName = "chart-image" + ReleaseContainerName = "chart-image" // ImageBasePath is the default base path for image path mappings // in a HelmRelease resource. ImageBasePath = "spec.values." // ImageRegistryPrefix is the annotation key prefix for image // registry path mappings. - ImageRegistryPrefix = "registry.fluxcd.io/" + ImageRegistryPrefix = "registry.fluxcd.io/" // ImageRepositoryPrefix is the annotation key prefix for image // repository path mappings. ImageRepositoryPrefix = "repository.fluxcd.io/" // ImageRepositoryPrefix is the annotation key prefix for image // tag path mappings. - ImageTagPrefix = "tag.fluxcd.io/" + ImageTagPrefix = "tag.fluxcd.io/" ) // ContainerImageMap holds the YAML dot notation paths to a diff --git a/cluster/kubernetes/resource/helmrelease_test.go b/pkg/cluster/kubernetes/resource/helmrelease_test.go similarity index 99% rename from cluster/kubernetes/resource/helmrelease_test.go rename to pkg/cluster/kubernetes/resource/helmrelease_test.go index 4819c7a1b0..4d145d47ea 100644 --- a/cluster/kubernetes/resource/helmrelease_test.go +++ b/pkg/cluster/kubernetes/resource/helmrelease_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" "testing" - "github.com/fluxcd/flux/resource" + "github.com/fluxcd/flux/pkg/resource" ) func TestSortedContainers(t *testing.T) { diff --git a/cluster/kubernetes/resource/list.go b/pkg/cluster/kubernetes/resource/list.go similarity index 100% rename from cluster/kubernetes/resource/list.go rename to pkg/cluster/kubernetes/resource/list.go diff --git a/cluster/kubernetes/resource/load.go b/pkg/cluster/kubernetes/resource/load.go similarity index 100% rename from cluster/kubernetes/resource/load.go rename to pkg/cluster/kubernetes/resource/load.go diff --git a/cluster/kubernetes/resource/load_test.go b/pkg/cluster/kubernetes/resource/load_test.go similarity index 98% rename from cluster/kubernetes/resource/load_test.go rename to pkg/cluster/kubernetes/resource/load_test.go index 9d90bf9482..fb1af6033e 100644 --- a/cluster/kubernetes/resource/load_test.go +++ b/pkg/cluster/kubernetes/resource/load_test.go @@ -8,8 +8,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/fluxcd/flux/cluster/kubernetes/testfiles" - "github.com/fluxcd/flux/resource" + "github.com/fluxcd/flux/pkg/cluster/kubernetes/testfiles" + "github.com/fluxcd/flux/pkg/resource" ) // for convenience diff --git a/cluster/kubernetes/resource/namespace.go b/pkg/cluster/kubernetes/resource/namespace.go similarity index 100% rename from cluster/kubernetes/resource/namespace.go rename to pkg/cluster/kubernetes/resource/namespace.go diff --git a/cluster/kubernetes/resource/resource.go b/pkg/cluster/kubernetes/resource/resource.go similarity index 98% rename from cluster/kubernetes/resource/resource.go rename to pkg/cluster/kubernetes/resource/resource.go index d76596161f..6c4b3ef9dc 100644 --- a/cluster/kubernetes/resource/resource.go +++ b/pkg/cluster/kubernetes/resource/resource.go @@ -6,9 +6,9 @@ import ( jsonyaml "github.com/ghodss/yaml" "gopkg.in/yaml.v2" - fluxerr "github.com/fluxcd/flux/errors" - "github.com/fluxcd/flux/policy" - "github.com/fluxcd/flux/resource" + fluxerr "github.com/fluxcd/flux/pkg/errors" + "github.com/fluxcd/flux/pkg/policy" + "github.com/fluxcd/flux/pkg/resource" ) const ( diff --git a/cluster/kubernetes/resource/spec.go b/pkg/cluster/kubernetes/resource/spec.go similarity index 91% rename from cluster/kubernetes/resource/spec.go rename to pkg/cluster/kubernetes/resource/spec.go index 8a0f14779b..717aa26e88 100644 --- a/cluster/kubernetes/resource/spec.go +++ b/pkg/cluster/kubernetes/resource/spec.go @@ -3,8 +3,8 @@ package resource import ( "fmt" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/resource" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/resource" ) // Types that daemonsets, deployments, and other things have in @@ -22,7 +22,7 @@ type PodTemplate struct { func (t PodTemplate) Containers() []resource.Container { var result []resource.Container - // FIXME(https://github.com/fluxcd/flux/issues/1269): account for possible errors (x2) + // FIXME(https://github.com/fluxcd/flux/pkg/issues/1269): account for possible errors (x2) for _, c := range t.Spec.Containers { im, _ := image.ParseRef(c.Image) result = append(result, resource.Container{Name: c.Name, Image: im}) diff --git a/cluster/kubernetes/resource/statefulset.go b/pkg/cluster/kubernetes/resource/statefulset.go similarity index 85% rename from cluster/kubernetes/resource/statefulset.go rename to pkg/cluster/kubernetes/resource/statefulset.go index 2bba911116..79b019734a 100644 --- a/cluster/kubernetes/resource/statefulset.go +++ b/pkg/cluster/kubernetes/resource/statefulset.go @@ -1,8 +1,8 @@ package resource import ( - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/resource" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/resource" ) type StatefulSet struct { diff --git a/cluster/kubernetes/resourcekinds.go b/pkg/cluster/kubernetes/resourcekinds.go similarity index 98% rename from cluster/kubernetes/resourcekinds.go rename to pkg/cluster/kubernetes/resourcekinds.go index fc1a455bd6..0509afcc04 100644 --- a/cluster/kubernetes/resourcekinds.go +++ b/pkg/cluster/kubernetes/resourcekinds.go @@ -10,13 +10,13 @@ import ( apiv1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/fluxcd/flux/cluster" - kresource "github.com/fluxcd/flux/cluster/kubernetes/resource" - "github.com/fluxcd/flux/image" hr_v1beta1 "github.com/fluxcd/flux/integrations/apis/flux.weave.works/v1beta1" fhr_v1alpha2 "github.com/fluxcd/flux/integrations/apis/helm.integrations.flux.weave.works/v1alpha2" - "github.com/fluxcd/flux/policy" - "github.com/fluxcd/flux/resource" + "github.com/fluxcd/flux/pkg/cluster" + kresource "github.com/fluxcd/flux/pkg/cluster/kubernetes/resource" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/policy" + "github.com/fluxcd/flux/pkg/resource" ) // AntecedentAnnotation is an annotation on a resource indicating that diff --git a/cluster/kubernetes/sshkeyring.go b/pkg/cluster/kubernetes/sshkeyring.go similarity index 99% rename from cluster/kubernetes/sshkeyring.go rename to pkg/cluster/kubernetes/sshkeyring.go index 331118acf2..9d30a8ceed 100644 --- a/cluster/kubernetes/sshkeyring.go +++ b/pkg/cluster/kubernetes/sshkeyring.go @@ -11,7 +11,7 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/kubernetes/typed/core/v1" - "github.com/fluxcd/flux/ssh" + "github.com/fluxcd/flux/pkg/ssh" ) const ( diff --git a/cluster/kubernetes/sync.go b/pkg/cluster/kubernetes/sync.go similarity index 98% rename from cluster/kubernetes/sync.go rename to pkg/cluster/kubernetes/sync.go index f433374162..01790f13ab 100644 --- a/cluster/kubernetes/sync.go +++ b/pkg/cluster/kubernetes/sync.go @@ -25,10 +25,10 @@ import ( "k8s.io/client-go/discovery" "k8s.io/client-go/rest" - "github.com/fluxcd/flux/cluster" - kresource "github.com/fluxcd/flux/cluster/kubernetes/resource" - "github.com/fluxcd/flux/policy" - "github.com/fluxcd/flux/resource" + "github.com/fluxcd/flux/pkg/cluster" + kresource "github.com/fluxcd/flux/pkg/cluster/kubernetes/resource" + "github.com/fluxcd/flux/pkg/policy" + "github.com/fluxcd/flux/pkg/resource" ) const ( diff --git a/cluster/kubernetes/sync_test.go b/pkg/cluster/kubernetes/sync_test.go similarity index 99% rename from cluster/kubernetes/sync_test.go rename to pkg/cluster/kubernetes/sync_test.go index 9a0c69d2fe..8dfc78c799 100644 --- a/cluster/kubernetes/sync_test.go +++ b/pkg/cluster/kubernetes/sync_test.go @@ -25,11 +25,11 @@ import ( corefake "k8s.io/client-go/kubernetes/fake" k8s_testing "k8s.io/client-go/testing" - "github.com/fluxcd/flux/cluster" - kresource "github.com/fluxcd/flux/cluster/kubernetes/resource" fhrfake "github.com/fluxcd/flux/integrations/client/clientset/versioned/fake" - "github.com/fluxcd/flux/resource" - "github.com/fluxcd/flux/sync" + "github.com/fluxcd/flux/pkg/cluster" + kresource "github.com/fluxcd/flux/pkg/cluster/kubernetes/resource" + "github.com/fluxcd/flux/pkg/resource" + "github.com/fluxcd/flux/pkg/sync" ) const ( diff --git a/cluster/kubernetes/testfiles/data.go b/pkg/cluster/kubernetes/testfiles/data.go similarity index 99% rename from cluster/kubernetes/testfiles/data.go rename to pkg/cluster/kubernetes/testfiles/data.go index e050155887..9e479a6fd1 100644 --- a/cluster/kubernetes/testfiles/data.go +++ b/pkg/cluster/kubernetes/testfiles/data.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/fluxcd/flux/resource" + "github.com/fluxcd/flux/pkg/resource" ) func TempDir(t *testing.T) (string, func()) { diff --git a/cluster/kubernetes/testfiles/data_test.go b/pkg/cluster/kubernetes/testfiles/data_test.go similarity index 100% rename from cluster/kubernetes/testfiles/data_test.go rename to pkg/cluster/kubernetes/testfiles/data_test.go diff --git a/cluster/kubernetes/update.go b/pkg/cluster/kubernetes/update.go similarity index 92% rename from cluster/kubernetes/update.go rename to pkg/cluster/kubernetes/update.go index 54cd0131ea..78eeb6c0f2 100644 --- a/cluster/kubernetes/update.go +++ b/pkg/cluster/kubernetes/update.go @@ -4,9 +4,9 @@ import ( "fmt" "strings" - kresource "github.com/fluxcd/flux/cluster/kubernetes/resource" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/resource" + kresource "github.com/fluxcd/flux/pkg/cluster/kubernetes/resource" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/resource" ) // updateWorkloadContainer takes a YAML document stream (one or more diff --git a/cluster/kubernetes/update_test.go b/pkg/cluster/kubernetes/update_test.go similarity index 99% rename from cluster/kubernetes/update_test.go rename to pkg/cluster/kubernetes/update_test.go index 07d7dc5886..46b30fd58f 100644 --- a/cluster/kubernetes/update_test.go +++ b/pkg/cluster/kubernetes/update_test.go @@ -3,9 +3,9 @@ package kubernetes import ( "testing" - kresource "github.com/fluxcd/flux/cluster/kubernetes/resource" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/resource" + kresource "github.com/fluxcd/flux/pkg/cluster/kubernetes/resource" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/resource" ) type update struct { @@ -975,6 +975,7 @@ spec: ` const case14resource = "maria:helmrelease/mariadb" + var case14ImageMap = kresource.ContainerImageMap{ BasePath: kresource.ImageBasePath, Repository: "mariadb.customImage", diff --git a/cluster/mock/mock.go b/pkg/cluster/mock/mock.go similarity index 94% rename from cluster/mock/mock.go rename to pkg/cluster/mock/mock.go index d78c6e0c02..7d2853ca65 100644 --- a/cluster/mock/mock.go +++ b/pkg/cluster/mock/mock.go @@ -4,11 +4,11 @@ import ( "bytes" "context" - "github.com/fluxcd/flux/cluster" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/manifests" - "github.com/fluxcd/flux/resource" - "github.com/fluxcd/flux/ssh" + "github.com/fluxcd/flux/pkg/cluster" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/manifests" + "github.com/fluxcd/flux/pkg/resource" + "github.com/fluxcd/flux/pkg/ssh" ) // Doubles as a cluster.Cluster and cluster.Manifests implementation diff --git a/cluster/sync.go b/pkg/cluster/sync.go similarity index 96% rename from cluster/sync.go rename to pkg/cluster/sync.go index b82a0dc740..5045c86a37 100644 --- a/cluster/sync.go +++ b/pkg/cluster/sync.go @@ -3,7 +3,7 @@ package cluster import ( "strings" - "github.com/fluxcd/flux/resource" + "github.com/fluxcd/flux/pkg/resource" ) // Definitions for use in synchronising a cluster with a git repo. diff --git a/daemon/daemon.go b/pkg/daemon/daemon.go similarity index 97% rename from daemon/daemon.go rename to pkg/daemon/daemon.go index 9112e9a3a3..d05a8ca327 100644 --- a/daemon/daemon.go +++ b/pkg/daemon/daemon.go @@ -11,24 +11,24 @@ import ( "github.com/go-kit/kit/log" "github.com/pkg/errors" - "github.com/fluxcd/flux/api" - "github.com/fluxcd/flux/api/v10" - "github.com/fluxcd/flux/api/v11" - "github.com/fluxcd/flux/api/v6" - "github.com/fluxcd/flux/api/v9" - "github.com/fluxcd/flux/cluster" - "github.com/fluxcd/flux/event" - "github.com/fluxcd/flux/git" - "github.com/fluxcd/flux/guid" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/job" - "github.com/fluxcd/flux/manifests" - "github.com/fluxcd/flux/policy" - "github.com/fluxcd/flux/registry" - "github.com/fluxcd/flux/release" - "github.com/fluxcd/flux/resource" - "github.com/fluxcd/flux/sync" - "github.com/fluxcd/flux/update" + "github.com/fluxcd/flux/pkg/api" + "github.com/fluxcd/flux/pkg/api/v10" + "github.com/fluxcd/flux/pkg/api/v11" + "github.com/fluxcd/flux/pkg/api/v6" + "github.com/fluxcd/flux/pkg/api/v9" + "github.com/fluxcd/flux/pkg/cluster" + "github.com/fluxcd/flux/pkg/event" + "github.com/fluxcd/flux/pkg/git" + "github.com/fluxcd/flux/pkg/guid" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/job" + "github.com/fluxcd/flux/pkg/manifests" + "github.com/fluxcd/flux/pkg/policy" + "github.com/fluxcd/flux/pkg/registry" + "github.com/fluxcd/flux/pkg/release" + "github.com/fluxcd/flux/pkg/resource" + "github.com/fluxcd/flux/pkg/sync" + "github.com/fluxcd/flux/pkg/update" ) const ( diff --git a/daemon/daemon_test.go b/pkg/daemon/daemon_test.go similarity index 96% rename from daemon/daemon_test.go rename to pkg/daemon/daemon_test.go index e3b1d02e5c..ad55a0b93b 100644 --- a/daemon/daemon_test.go +++ b/pkg/daemon/daemon_test.go @@ -15,25 +15,25 @@ import ( "github.com/stretchr/testify/assert" - "github.com/fluxcd/flux/api/v10" - "github.com/fluxcd/flux/api/v11" - "github.com/fluxcd/flux/api/v6" - "github.com/fluxcd/flux/api/v9" - "github.com/fluxcd/flux/cluster" - "github.com/fluxcd/flux/cluster/kubernetes" - "github.com/fluxcd/flux/cluster/mock" - "github.com/fluxcd/flux/event" - "github.com/fluxcd/flux/git" - "github.com/fluxcd/flux/git/gittest" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/job" - "github.com/fluxcd/flux/manifests" - "github.com/fluxcd/flux/policy" - "github.com/fluxcd/flux/registry" - registryMock "github.com/fluxcd/flux/registry/mock" - "github.com/fluxcd/flux/resource" - fluxsync "github.com/fluxcd/flux/sync" - "github.com/fluxcd/flux/update" + "github.com/fluxcd/flux/pkg/api/v10" + "github.com/fluxcd/flux/pkg/api/v11" + "github.com/fluxcd/flux/pkg/api/v6" + "github.com/fluxcd/flux/pkg/api/v9" + "github.com/fluxcd/flux/pkg/cluster" + "github.com/fluxcd/flux/pkg/cluster/kubernetes" + "github.com/fluxcd/flux/pkg/cluster/mock" + "github.com/fluxcd/flux/pkg/event" + "github.com/fluxcd/flux/pkg/git" + "github.com/fluxcd/flux/pkg/git/gittest" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/job" + "github.com/fluxcd/flux/pkg/manifests" + "github.com/fluxcd/flux/pkg/policy" + "github.com/fluxcd/flux/pkg/registry" + registryMock "github.com/fluxcd/flux/pkg/registry/mock" + "github.com/fluxcd/flux/pkg/resource" + fluxsync "github.com/fluxcd/flux/pkg/sync" + "github.com/fluxcd/flux/pkg/update" ) const ( diff --git a/daemon/errors.go b/pkg/daemon/errors.go similarity index 90% rename from daemon/errors.go rename to pkg/daemon/errors.go index 23461f7603..b318df5227 100644 --- a/daemon/errors.go +++ b/pkg/daemon/errors.go @@ -4,9 +4,9 @@ import ( "fmt" "sync" - fluxerr "github.com/fluxcd/flux/errors" - "github.com/fluxcd/flux/job" - "github.com/fluxcd/flux/resource" + fluxerr "github.com/fluxcd/flux/pkg/errors" + "github.com/fluxcd/flux/pkg/job" + "github.com/fluxcd/flux/pkg/resource" ) type SyncErrors struct { @@ -35,7 +35,7 @@ to make sure you're not running into any corner cases. If you think your files are all OK and you are still getting this message, please log an issue at - https://github.com/fluxcd/flux/issues + https://github.com/fluxcd/flux/pkg/issues and include the problematic file, if possible. `, @@ -62,7 +62,7 @@ If you get this error repeatedly, it's probably a bug. Please log an issue describing what you were attempting, and posting logs from the daemon if possible: - https://github.com/fluxcd/flux/issues + https://github.com/fluxcd/flux/pkg/issues `, } diff --git a/daemon/images.go b/pkg/daemon/images.go similarity index 96% rename from daemon/images.go rename to pkg/daemon/images.go index dc5645410f..c2fd6e6147 100644 --- a/daemon/images.go +++ b/pkg/daemon/images.go @@ -7,10 +7,10 @@ import ( "github.com/go-kit/kit/log" "github.com/pkg/errors" - "github.com/fluxcd/flux/cluster" - "github.com/fluxcd/flux/policy" - "github.com/fluxcd/flux/resource" - "github.com/fluxcd/flux/update" + "github.com/fluxcd/flux/pkg/cluster" + "github.com/fluxcd/flux/pkg/policy" + "github.com/fluxcd/flux/pkg/resource" + "github.com/fluxcd/flux/pkg/update" ) func (d *Daemon) pollForNewAutomatedWorkloadImages(logger log.Logger) { diff --git a/daemon/images_test.go b/pkg/daemon/images_test.go similarity index 95% rename from daemon/images_test.go rename to pkg/daemon/images_test.go index 736302db74..00ed74654d 100644 --- a/daemon/images_test.go +++ b/pkg/daemon/images_test.go @@ -6,13 +6,13 @@ import ( "github.com/go-kit/kit/log" - "github.com/fluxcd/flux/cluster" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/policy" - "github.com/fluxcd/flux/registry" - registryMock "github.com/fluxcd/flux/registry/mock" - "github.com/fluxcd/flux/resource" - "github.com/fluxcd/flux/update" + "github.com/fluxcd/flux/pkg/cluster" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/policy" + "github.com/fluxcd/flux/pkg/registry" + registryMock "github.com/fluxcd/flux/pkg/registry/mock" + "github.com/fluxcd/flux/pkg/resource" + "github.com/fluxcd/flux/pkg/update" ) const ( diff --git a/daemon/loop.go b/pkg/daemon/loop.go similarity index 98% rename from daemon/loop.go rename to pkg/daemon/loop.go index b25394fb60..3a6dfe692c 100644 --- a/daemon/loop.go +++ b/pkg/daemon/loop.go @@ -8,9 +8,9 @@ import ( "github.com/go-kit/kit/log" - "github.com/fluxcd/flux/git" - fluxmetrics "github.com/fluxcd/flux/metrics" - fluxsync "github.com/fluxcd/flux/sync" + "github.com/fluxcd/flux/pkg/git" + fluxmetrics "github.com/fluxcd/flux/pkg/metrics" + fluxsync "github.com/fluxcd/flux/pkg/sync" ) type LoopVars struct { diff --git a/daemon/metrics.go b/pkg/daemon/metrics.go similarity index 97% rename from daemon/metrics.go rename to pkg/daemon/metrics.go index dfe4f3692c..7cad9a1667 100644 --- a/daemon/metrics.go +++ b/pkg/daemon/metrics.go @@ -4,7 +4,7 @@ import ( "github.com/go-kit/kit/metrics/prometheus" stdprometheus "github.com/prometheus/client_golang/prometheus" - fluxmetrics "github.com/fluxcd/flux/metrics" + fluxmetrics "github.com/fluxcd/flux/pkg/metrics" ) var ( diff --git a/daemon/note.go b/pkg/daemon/note.go similarity index 69% rename from daemon/note.go rename to pkg/daemon/note.go index f4e068e20d..25ffe8c3f8 100644 --- a/daemon/note.go +++ b/pkg/daemon/note.go @@ -1,8 +1,8 @@ package daemon import ( - "github.com/fluxcd/flux/job" - "github.com/fluxcd/flux/update" + "github.com/fluxcd/flux/pkg/job" + "github.com/fluxcd/flux/pkg/update" ) type note struct { diff --git a/daemon/sync.go b/pkg/daemon/sync.go similarity index 97% rename from daemon/sync.go rename to pkg/daemon/sync.go index 43dc656e53..0c7877bddd 100644 --- a/daemon/sync.go +++ b/pkg/daemon/sync.go @@ -9,13 +9,13 @@ import ( "path/filepath" "time" - "github.com/fluxcd/flux/cluster" - "github.com/fluxcd/flux/event" - "github.com/fluxcd/flux/git" - "github.com/fluxcd/flux/manifests" - "github.com/fluxcd/flux/resource" - fluxsync "github.com/fluxcd/flux/sync" - "github.com/fluxcd/flux/update" + "github.com/fluxcd/flux/pkg/cluster" + "github.com/fluxcd/flux/pkg/event" + "github.com/fluxcd/flux/pkg/git" + "github.com/fluxcd/flux/pkg/manifests" + "github.com/fluxcd/flux/pkg/resource" + fluxsync "github.com/fluxcd/flux/pkg/sync" + "github.com/fluxcd/flux/pkg/update" ) // revisionRatchet is for keeping track of transitions between diff --git a/daemon/sync_test.go b/pkg/daemon/sync_test.go similarity index 94% rename from daemon/sync_test.go rename to pkg/daemon/sync_test.go index 364148e98b..39525a025c 100644 --- a/daemon/sync_test.go +++ b/pkg/daemon/sync_test.go @@ -14,18 +14,18 @@ import ( "github.com/go-kit/kit/log" - "github.com/fluxcd/flux/cluster" - "github.com/fluxcd/flux/cluster/kubernetes" - "github.com/fluxcd/flux/cluster/kubernetes/testfiles" - "github.com/fluxcd/flux/cluster/mock" - "github.com/fluxcd/flux/event" - "github.com/fluxcd/flux/git" - "github.com/fluxcd/flux/git/gittest" - "github.com/fluxcd/flux/job" - "github.com/fluxcd/flux/manifests" - registryMock "github.com/fluxcd/flux/registry/mock" - "github.com/fluxcd/flux/resource" - fluxsync "github.com/fluxcd/flux/sync" + "github.com/fluxcd/flux/pkg/cluster" + "github.com/fluxcd/flux/pkg/cluster/kubernetes" + "github.com/fluxcd/flux/pkg/cluster/kubernetes/testfiles" + "github.com/fluxcd/flux/pkg/cluster/mock" + "github.com/fluxcd/flux/pkg/event" + "github.com/fluxcd/flux/pkg/git" + "github.com/fluxcd/flux/pkg/git/gittest" + "github.com/fluxcd/flux/pkg/job" + "github.com/fluxcd/flux/pkg/manifests" + registryMock "github.com/fluxcd/flux/pkg/registry/mock" + "github.com/fluxcd/flux/pkg/resource" + fluxsync "github.com/fluxcd/flux/pkg/sync" ) const ( diff --git a/errors/errors.go b/pkg/errors/errors.go similarity index 97% rename from errors/errors.go rename to pkg/errors/errors.go index dc2aa59e26..0c92e26fad 100644 --- a/errors/errors.go +++ b/pkg/errors/errors.go @@ -86,7 +86,7 @@ We don't have a specific help message for the error above. It would help us remedy this if you log an issue at - https://github.com/fluxcd/flux/issues + https://github.com/fluxcd/flux/pkg/issues saying what you were doing when you saw this, and quoting the message at the top. diff --git a/errors/errors_test.go b/pkg/errors/errors_test.go similarity index 100% rename from errors/errors_test.go rename to pkg/errors/errors_test.go diff --git a/event/event.go b/pkg/event/event.go similarity index 99% rename from event/event.go rename to pkg/event/event.go index 7fe61c41df..8866b4a4a2 100644 --- a/event/event.go +++ b/pkg/event/event.go @@ -7,9 +7,9 @@ import ( "strings" "time" + "github.com/fluxcd/flux/pkg/resource" + "github.com/fluxcd/flux/pkg/update" "github.com/pkg/errors" - "github.com/fluxcd/flux/resource" - "github.com/fluxcd/flux/update" ) // These are all the types of events. diff --git a/event/event_test.go b/pkg/event/event_test.go similarity index 98% rename from event/event_test.go rename to pkg/event/event_test.go index 21f3f76d7b..a09a433478 100644 --- a/event/event_test.go +++ b/pkg/event/event_test.go @@ -4,7 +4,7 @@ import ( "encoding/json" "testing" - "github.com/fluxcd/flux/update" + "github.com/fluxcd/flux/pkg/update" ) var ( diff --git a/git/errors.go b/pkg/git/errors.go similarity index 98% rename from git/errors.go rename to pkg/git/errors.go index 96bca1ef22..4feb161197 100644 --- a/git/errors.go +++ b/pkg/git/errors.go @@ -4,7 +4,7 @@ import ( "errors" "strings" - fluxerr "github.com/fluxcd/flux/errors" + fluxerr "github.com/fluxcd/flux/pkg/errors" ) var NoRepoError = &fluxerr.Error{ diff --git a/git/export.go b/pkg/git/export.go similarity index 100% rename from git/export.go rename to pkg/git/export.go diff --git a/git/export_test.go b/pkg/git/export_test.go similarity index 93% rename from git/export_test.go rename to pkg/git/export_test.go index fc9fe30ff4..676dd00e3a 100644 --- a/git/export_test.go +++ b/pkg/git/export_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/fluxcd/flux/cluster/kubernetes/testfiles" + "github.com/fluxcd/flux/pkg/cluster/kubernetes/testfiles" ) func TestExportAtRevision(t *testing.T) { diff --git a/git/gittest/repo.go b/pkg/git/gittest/repo.go similarity index 96% rename from git/gittest/repo.go rename to pkg/git/gittest/repo.go index d8237e6e38..c31495389b 100644 --- a/git/gittest/repo.go +++ b/pkg/git/gittest/repo.go @@ -7,9 +7,9 @@ import ( "path/filepath" "testing" - "github.com/fluxcd/flux/cluster/kubernetes/testfiles" - "github.com/fluxcd/flux/git" - "github.com/fluxcd/flux/resource" + "github.com/fluxcd/flux/pkg/cluster/kubernetes/testfiles" + "github.com/fluxcd/flux/pkg/git" + "github.com/fluxcd/flux/pkg/resource" ) // Repo creates a new clone-able git repo, pre-populated with some kubernetes diff --git a/git/gittest/repo_test.go b/pkg/git/gittest/repo_test.go similarity index 97% rename from git/gittest/repo_test.go rename to pkg/git/gittest/repo_test.go index 678544b231..50b9c92e7a 100644 --- a/git/gittest/repo_test.go +++ b/pkg/git/gittest/repo_test.go @@ -11,9 +11,9 @@ import ( "context" - "github.com/fluxcd/flux/cluster/kubernetes/testfiles" - "github.com/fluxcd/flux/git" - "github.com/fluxcd/flux/gpg/gpgtest" + "github.com/fluxcd/flux/pkg/cluster/kubernetes/testfiles" + "github.com/fluxcd/flux/pkg/git" + "github.com/fluxcd/flux/pkg/gpg/gpgtest" ) type Note struct { diff --git a/git/mirrors.go b/pkg/git/mirrors.go similarity index 100% rename from git/mirrors.go rename to pkg/git/mirrors.go diff --git a/git/operations.go b/pkg/git/operations.go similarity index 100% rename from git/operations.go rename to pkg/git/operations.go diff --git a/git/operations_test.go b/pkg/git/operations_test.go similarity index 99% rename from git/operations_test.go rename to pkg/git/operations_test.go index b927e6b05c..5b5e7d2e7d 100644 --- a/git/operations_test.go +++ b/pkg/git/operations_test.go @@ -11,8 +11,8 @@ import ( "testing" "time" + "github.com/fluxcd/flux/pkg/cluster/kubernetes/testfiles" "github.com/stretchr/testify/assert" - "github.com/fluxcd/flux/cluster/kubernetes/testfiles" ) const ( diff --git a/git/repo.go b/pkg/git/repo.go similarity index 100% rename from git/repo.go rename to pkg/git/repo.go diff --git a/git/signature.go b/pkg/git/signature.go similarity index 100% rename from git/signature.go rename to pkg/git/signature.go diff --git a/git/url.go b/pkg/git/url.go similarity index 100% rename from git/url.go rename to pkg/git/url.go diff --git a/git/url_test.go b/pkg/git/url_test.go similarity index 100% rename from git/url_test.go rename to pkg/git/url_test.go diff --git a/git/working.go b/pkg/git/working.go similarity index 100% rename from git/working.go rename to pkg/git/working.go diff --git a/gpg/gpg.go b/pkg/gpg/gpg.go similarity index 100% rename from gpg/gpg.go rename to pkg/gpg/gpg.go diff --git a/gpg/gpgtest/gpg.go b/pkg/gpg/gpgtest/gpg.go similarity index 96% rename from gpg/gpgtest/gpg.go rename to pkg/gpg/gpgtest/gpg.go index 3275977169..11881f9190 100644 --- a/gpg/gpgtest/gpg.go +++ b/pkg/gpg/gpgtest/gpg.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/fluxcd/flux/cluster/kubernetes/testfiles" + "github.com/fluxcd/flux/pkg/cluster/kubernetes/testfiles" ) // GPGKey creates a new, temporary GPG home directory and a public/private key diff --git a/guid/guid.go b/pkg/guid/guid.go similarity index 100% rename from guid/guid.go rename to pkg/guid/guid.go diff --git a/http/accept.go b/pkg/http/accept.go similarity index 100% rename from http/accept.go rename to pkg/http/accept.go diff --git a/http/accept_test.go b/pkg/http/accept_test.go similarity index 100% rename from http/accept_test.go rename to pkg/http/accept_test.go diff --git a/http/client/client.go b/pkg/http/client/client.go similarity index 95% rename from http/client/client.go rename to pkg/http/client/client.go index a676fab7f2..32be770d02 100644 --- a/http/client/client.go +++ b/pkg/http/client/client.go @@ -12,16 +12,16 @@ import ( "github.com/gorilla/mux" "github.com/pkg/errors" - "github.com/fluxcd/flux/api" - "github.com/fluxcd/flux/api/v10" - "github.com/fluxcd/flux/api/v11" - "github.com/fluxcd/flux/api/v6" - "github.com/fluxcd/flux/api/v9" - fluxerr "github.com/fluxcd/flux/errors" - "github.com/fluxcd/flux/event" - transport "github.com/fluxcd/flux/http" - "github.com/fluxcd/flux/job" - "github.com/fluxcd/flux/update" + "github.com/fluxcd/flux/pkg/api" + "github.com/fluxcd/flux/pkg/api/v10" + "github.com/fluxcd/flux/pkg/api/v11" + "github.com/fluxcd/flux/pkg/api/v6" + "github.com/fluxcd/flux/pkg/api/v9" + fluxerr "github.com/fluxcd/flux/pkg/errors" + "github.com/fluxcd/flux/pkg/event" + transport "github.com/fluxcd/flux/pkg/http" + "github.com/fluxcd/flux/pkg/job" + "github.com/fluxcd/flux/pkg/update" ) var ( diff --git a/http/daemon/server.go b/pkg/http/daemon/server.go similarity index 96% rename from http/daemon/server.go rename to pkg/http/daemon/server.go index fbe3ed30cd..451e9814d0 100644 --- a/http/daemon/server.go +++ b/pkg/http/daemon/server.go @@ -9,16 +9,16 @@ import ( "github.com/pkg/errors" stdprometheus "github.com/prometheus/client_golang/prometheus" + "github.com/fluxcd/flux/pkg/api" + "github.com/fluxcd/flux/pkg/api/v10" + "github.com/fluxcd/flux/pkg/api/v11" + "github.com/fluxcd/flux/pkg/api/v9" + transport "github.com/fluxcd/flux/pkg/http" + "github.com/fluxcd/flux/pkg/job" + fluxmetrics "github.com/fluxcd/flux/pkg/metrics" + "github.com/fluxcd/flux/pkg/resource" + "github.com/fluxcd/flux/pkg/update" "github.com/weaveworks/common/middleware" - "github.com/fluxcd/flux/api" - "github.com/fluxcd/flux/api/v10" - "github.com/fluxcd/flux/api/v11" - "github.com/fluxcd/flux/api/v9" - transport "github.com/fluxcd/flux/http" - "github.com/fluxcd/flux/job" - fluxmetrics "github.com/fluxcd/flux/metrics" - "github.com/fluxcd/flux/resource" - "github.com/fluxcd/flux/update" ) var ( diff --git a/http/daemon/server_test.go b/pkg/http/daemon/server_test.go similarity index 88% rename from http/daemon/server_test.go rename to pkg/http/daemon/server_test.go index a0036ea825..f948af98fa 100644 --- a/http/daemon/server_test.go +++ b/pkg/http/daemon/server_test.go @@ -3,7 +3,7 @@ package daemon import ( "testing" - "github.com/fluxcd/flux/http" + "github.com/fluxcd/flux/pkg/http" ) func TestRouterImplementsServer(t *testing.T) { diff --git a/http/daemon/upstream.go b/pkg/http/daemon/upstream.go similarity index 94% rename from http/daemon/upstream.go rename to pkg/http/daemon/upstream.go index 2f5e9e035e..d2e76c5d2c 100644 --- a/http/daemon/upstream.go +++ b/pkg/http/daemon/upstream.go @@ -16,12 +16,12 @@ import ( "github.com/pkg/errors" stdprometheus "github.com/prometheus/client_golang/prometheus" - "github.com/fluxcd/flux/api" - "github.com/fluxcd/flux/event" - transport "github.com/fluxcd/flux/http" - fluxclient "github.com/fluxcd/flux/http/client" - "github.com/fluxcd/flux/http/websocket" - "github.com/fluxcd/flux/remote/rpc" + "github.com/fluxcd/flux/pkg/api" + "github.com/fluxcd/flux/pkg/event" + transport "github.com/fluxcd/flux/pkg/http" + fluxclient "github.com/fluxcd/flux/pkg/http/client" + "github.com/fluxcd/flux/pkg/http/websocket" + "github.com/fluxcd/flux/pkg/remote/rpc" ) // Upstream handles communication from the daemon to a service diff --git a/http/daemon/upstream_test.go b/pkg/http/daemon/upstream_test.go similarity index 100% rename from http/daemon/upstream_test.go rename to pkg/http/daemon/upstream_test.go diff --git a/http/errors.go b/pkg/http/errors.go similarity index 84% rename from http/errors.go rename to pkg/http/errors.go index c5e90ecb83..dd643d3cb4 100644 --- a/http/errors.go +++ b/pkg/http/errors.go @@ -3,7 +3,7 @@ package http import ( "errors" - fluxerr "github.com/fluxcd/flux/errors" + fluxerr "github.com/fluxcd/flux/pkg/errors" ) var ErrorDeprecated = &fluxerr.Error{ @@ -12,11 +12,11 @@ var ErrorDeprecated = &fluxerr.Error{ This indicates your client (fluxctl) needs to be updated: please see - https://github.com/fluxcd/flux/releases + https://github.com/fluxcd/flux/pkg/releases If you still have this problem after upgrading, please file an issue at - https://github.com/fluxcd/flux/issues + https://github.com/fluxcd/flux/pkg/issues mentioning what you were attempting to do. `, @@ -44,13 +44,13 @@ func MakeAPINotFound(path string) *fluxerr.Error { This indicates that your client (probably fluxctl) is either out of date, or faulty. Please see - https://github.com/fluxcd/flux/releases + https://github.com/fluxcd/flux/pkg/releases for releases of fluxctl. If you still have problems, please file an issue at - https://github.com/fluxcd/flux/issues + https://github.com/fluxcd/flux/pkg/issues mentioning what you were attempting to do, and include this path: diff --git a/http/httperror/api_error.go b/pkg/http/httperror/api_error.go similarity index 100% rename from http/httperror/api_error.go rename to pkg/http/httperror/api_error.go diff --git a/http/routes.go b/pkg/http/routes.go similarity index 100% rename from http/routes.go rename to pkg/http/routes.go diff --git a/http/transport.go b/pkg/http/transport.go similarity index 99% rename from http/transport.go rename to pkg/http/transport.go index d6805b0264..58338f7a34 100644 --- a/http/transport.go +++ b/pkg/http/transport.go @@ -10,7 +10,7 @@ import ( "github.com/gorilla/mux" "github.com/pkg/errors" - fluxerr "github.com/fluxcd/flux/errors" + fluxerr "github.com/fluxcd/flux/pkg/errors" ) func DeprecateVersions(r *mux.Router, versions ...string) { diff --git a/http/validate.go b/pkg/http/validate.go similarity index 100% rename from http/validate.go rename to pkg/http/validate.go diff --git a/http/websocket/client.go b/pkg/http/websocket/client.go similarity index 97% rename from http/websocket/client.go rename to pkg/http/websocket/client.go index 7905aae9a4..0a07165b69 100644 --- a/http/websocket/client.go +++ b/pkg/http/websocket/client.go @@ -9,7 +9,7 @@ import ( "github.com/gorilla/websocket" "github.com/pkg/errors" - "github.com/fluxcd/flux/http/client" + "github.com/fluxcd/flux/pkg/http/client" ) type DialErr struct { diff --git a/http/websocket/ping.go b/pkg/http/websocket/ping.go similarity index 100% rename from http/websocket/ping.go rename to pkg/http/websocket/ping.go diff --git a/http/websocket/server.go b/pkg/http/websocket/server.go similarity index 100% rename from http/websocket/server.go rename to pkg/http/websocket/server.go diff --git a/http/websocket/websocket.go b/pkg/http/websocket/websocket.go similarity index 100% rename from http/websocket/websocket.go rename to pkg/http/websocket/websocket.go diff --git a/http/websocket/websocket_test.go b/pkg/http/websocket/websocket_test.go similarity index 97% rename from http/websocket/websocket_test.go rename to pkg/http/websocket/websocket_test.go index 961ad3647a..0948dd4826 100644 --- a/http/websocket/websocket_test.go +++ b/pkg/http/websocket/websocket_test.go @@ -9,7 +9,7 @@ import ( "sync" "testing" - "github.com/fluxcd/flux/http/client" + "github.com/fluxcd/flux/pkg/http/client" ) func TestToken(t *testing.T) { diff --git a/image/image.go b/pkg/image/image.go similarity index 100% rename from image/image.go rename to pkg/image/image.go diff --git a/image/image_test.go b/pkg/image/image_test.go similarity index 100% rename from image/image_test.go rename to pkg/image/image_test.go diff --git a/install/generate.go b/pkg/install/generate.go similarity index 96% rename from install/generate.go rename to pkg/install/generate.go index 680162ff32..e77da2765a 100644 --- a/install/generate.go +++ b/pkg/install/generate.go @@ -11,7 +11,7 @@ import ( "github.com/shurcooL/vfsgen" - "github.com/fluxcd/flux/install" + "github.com/fluxcd/flux/pkg/install" ) func main() { diff --git a/install/generated_templates.gogen.go b/pkg/install/generated_templates.gogen.go similarity index 100% rename from install/generated_templates.gogen.go rename to pkg/install/generated_templates.gogen.go diff --git a/install/install.go b/pkg/install/install.go similarity index 100% rename from install/install.go rename to pkg/install/install.go diff --git a/install/install_test.go b/pkg/install/install_test.go similarity index 100% rename from install/install_test.go rename to pkg/install/install_test.go diff --git a/install/templates/flux-account.yaml.tmpl b/pkg/install/templates/flux-account.yaml.tmpl similarity index 100% rename from install/templates/flux-account.yaml.tmpl rename to pkg/install/templates/flux-account.yaml.tmpl diff --git a/install/templates/flux-deployment.yaml.tmpl b/pkg/install/templates/flux-deployment.yaml.tmpl similarity index 100% rename from install/templates/flux-deployment.yaml.tmpl rename to pkg/install/templates/flux-deployment.yaml.tmpl diff --git a/install/templates/flux-secret.yaml.tmpl b/pkg/install/templates/flux-secret.yaml.tmpl similarity index 100% rename from install/templates/flux-secret.yaml.tmpl rename to pkg/install/templates/flux-secret.yaml.tmpl diff --git a/install/templates/memcache-dep.yaml.tmpl b/pkg/install/templates/memcache-dep.yaml.tmpl similarity index 100% rename from install/templates/memcache-dep.yaml.tmpl rename to pkg/install/templates/memcache-dep.yaml.tmpl diff --git a/install/templates/memcache-svc.yaml.tmpl b/pkg/install/templates/memcache-svc.yaml.tmpl similarity index 100% rename from install/templates/memcache-svc.yaml.tmpl rename to pkg/install/templates/memcache-svc.yaml.tmpl diff --git a/job/job.go b/pkg/job/job.go similarity index 99% rename from job/job.go rename to pkg/job/job.go index a59be284ca..10fe838ece 100644 --- a/job/job.go +++ b/pkg/job/job.go @@ -5,7 +5,7 @@ import ( "github.com/go-kit/kit/log" - "github.com/fluxcd/flux/update" + "github.com/fluxcd/flux/pkg/update" ) type ID string diff --git a/job/job_test.go b/pkg/job/job_test.go similarity index 100% rename from job/job_test.go rename to pkg/job/job_test.go diff --git a/job/status_cache.go b/pkg/job/status_cache.go similarity index 100% rename from job/status_cache.go rename to pkg/job/status_cache.go diff --git a/manifests/configaware.go b/pkg/manifests/configaware.go similarity index 99% rename from manifests/configaware.go rename to pkg/manifests/configaware.go index 4c61f40597..814ce7e192 100644 --- a/manifests/configaware.go +++ b/pkg/manifests/configaware.go @@ -11,8 +11,8 @@ import ( "strings" "sync" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/resource" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/resource" ) type resourceWithOrigin struct { diff --git a/manifests/configaware_test.go b/pkg/manifests/configaware_test.go similarity index 96% rename from manifests/configaware_test.go rename to pkg/manifests/configaware_test.go index 212a08816e..499b6a8b6a 100644 --- a/manifests/configaware_test.go +++ b/pkg/manifests/configaware_test.go @@ -10,11 +10,11 @@ import ( "github.com/go-kit/kit/log" "github.com/stretchr/testify/assert" - "github.com/fluxcd/flux/cluster/kubernetes" - "github.com/fluxcd/flux/cluster/kubernetes/testfiles" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/policy" - "github.com/fluxcd/flux/resource" + "github.com/fluxcd/flux/pkg/cluster/kubernetes" + "github.com/fluxcd/flux/pkg/cluster/kubernetes/testfiles" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/policy" + "github.com/fluxcd/flux/pkg/resource" ) func TestFindConfigFilePaths(t *testing.T) { diff --git a/manifests/configfile.go b/pkg/manifests/configfile.go similarity index 99% rename from manifests/configfile.go rename to pkg/manifests/configfile.go index 87c17df99d..a9ff84f232 100644 --- a/manifests/configfile.go +++ b/pkg/manifests/configfile.go @@ -13,7 +13,7 @@ import ( "github.com/pkg/errors" "gopkg.in/yaml.v2" - "github.com/fluxcd/flux/resource" + "github.com/fluxcd/flux/pkg/resource" ) const ( diff --git a/manifests/configfile_test.go b/pkg/manifests/configfile_test.go similarity index 99% rename from manifests/configfile_test.go rename to pkg/manifests/configfile_test.go index 3d0cc9eeb1..736a13e1bb 100644 --- a/manifests/configfile_test.go +++ b/pkg/manifests/configfile_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" "gopkg.in/yaml.v2" - "github.com/fluxcd/flux/resource" + "github.com/fluxcd/flux/pkg/resource" ) const patchUpdatedConfigFile = `--- diff --git a/manifests/manifests.go b/pkg/manifests/manifests.go similarity index 96% rename from manifests/manifests.go rename to pkg/manifests/manifests.go index e775f82915..814ae7a0fb 100644 --- a/manifests/manifests.go +++ b/pkg/manifests/manifests.go @@ -3,8 +3,8 @@ package manifests import ( "bytes" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/resource" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/resource" ) // Manifests represents a format for files or chunks of bytes diff --git a/manifests/rawfiles.go b/pkg/manifests/rawfiles.go similarity index 97% rename from manifests/rawfiles.go rename to pkg/manifests/rawfiles.go index 310f510b5f..9945ba736d 100644 --- a/manifests/rawfiles.go +++ b/pkg/manifests/rawfiles.go @@ -7,8 +7,8 @@ import ( "os" "path/filepath" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/resource" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/resource" ) type rawFiles struct { diff --git a/manifests/store.go b/pkg/manifests/store.go similarity index 93% rename from manifests/store.go rename to pkg/manifests/store.go index 6ac37e2c10..090f86bdcc 100644 --- a/manifests/store.go +++ b/pkg/manifests/store.go @@ -4,8 +4,8 @@ import ( "context" "fmt" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/resource" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/resource" ) type StoreError struct { diff --git a/metrics/metrics.go b/pkg/metrics/metrics.go similarity index 100% rename from metrics/metrics.go rename to pkg/metrics/metrics.go diff --git a/policy/pattern.go b/pkg/policy/pattern.go similarity index 98% rename from policy/pattern.go rename to pkg/policy/pattern.go index c5a638c4f1..888bad6a6f 100644 --- a/policy/pattern.go +++ b/pkg/policy/pattern.go @@ -5,8 +5,8 @@ import ( "strings" "github.com/Masterminds/semver" + "github.com/fluxcd/flux/pkg/image" "github.com/ryanuber/go-glob" - "github.com/fluxcd/flux/image" ) const ( diff --git a/policy/pattern_test.go b/pkg/policy/pattern_test.go similarity index 100% rename from policy/pattern_test.go rename to pkg/policy/pattern_test.go diff --git a/policy/policy.go b/pkg/policy/policy.go similarity index 100% rename from policy/policy.go rename to pkg/policy/policy.go diff --git a/policy/policy_test.go b/pkg/policy/policy_test.go similarity index 100% rename from policy/policy_test.go rename to pkg/policy/policy_test.go diff --git a/registry/aws.go b/pkg/registry/aws.go similarity index 99% rename from registry/aws.go rename to pkg/registry/aws.go index a15c3d9f7f..0011969d12 100644 --- a/registry/aws.go +++ b/pkg/registry/aws.go @@ -8,7 +8,7 @@ import ( // References: // - https://github.com/bzon/ecr-k8s-secret-creator // - https://github.com/kubernetes/kubernetes/blob/master/pkg/credentialprovider/aws/aws_credentials.go -// - https://github.com/fluxcd/flux/pull/1455 +// - https://github.com/fluxcd/flux/pkg/pull/1455 import ( "strings" diff --git a/registry/azure.go b/pkg/registry/azure.go similarity index 100% rename from registry/azure.go rename to pkg/registry/azure.go diff --git a/registry/azure_test.go b/pkg/registry/azure_test.go similarity index 100% rename from registry/azure_test.go rename to pkg/registry/azure_test.go diff --git a/registry/cache/cache.go b/pkg/registry/cache/cache.go similarity index 97% rename from registry/cache/cache.go rename to pkg/registry/cache/cache.go index 331191e9a8..64326ed13c 100644 --- a/registry/cache/cache.go +++ b/pkg/registry/cache/cache.go @@ -4,7 +4,7 @@ import ( "strings" "time" - "github.com/fluxcd/flux/image" + "github.com/fluxcd/flux/pkg/image" ) type Reader interface { diff --git a/registry/cache/doc.go b/pkg/registry/cache/doc.go similarity index 100% rename from registry/cache/doc.go rename to pkg/registry/cache/doc.go diff --git a/registry/cache/memcached/integration_test.go b/pkg/registry/cache/memcached/integration_test.go similarity index 94% rename from registry/cache/memcached/integration_test.go rename to pkg/registry/cache/memcached/integration_test.go index 55b06ced06..b5e989eff2 100644 --- a/registry/cache/memcached/integration_test.go +++ b/pkg/registry/cache/memcached/integration_test.go @@ -12,10 +12,10 @@ import ( "github.com/go-kit/kit/log" "github.com/stretchr/testify/assert" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/registry" - "github.com/fluxcd/flux/registry/cache" - "github.com/fluxcd/flux/registry/middleware" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/registry" + "github.com/fluxcd/flux/pkg/registry/cache" + "github.com/fluxcd/flux/pkg/registry/middleware" ) // memcachedIPs flag from memcached_test.go diff --git a/registry/cache/memcached/memcached.go b/pkg/registry/cache/memcached/memcached.go similarity index 99% rename from registry/cache/memcached/memcached.go rename to pkg/registry/cache/memcached/memcached.go index 7ff5235e15..001bbf3377 100644 --- a/registry/cache/memcached/memcached.go +++ b/pkg/registry/cache/memcached/memcached.go @@ -23,7 +23,7 @@ import ( "github.com/go-kit/kit/log" "github.com/pkg/errors" - "github.com/fluxcd/flux/registry/cache" + "github.com/fluxcd/flux/pkg/registry/cache" ) const ( diff --git a/registry/cache/memcached/memcached_test.go b/pkg/registry/cache/memcached/memcached_test.go similarity index 100% rename from registry/cache/memcached/memcached_test.go rename to pkg/registry/cache/memcached/memcached_test.go diff --git a/registry/cache/monitoring.go b/pkg/registry/cache/monitoring.go similarity index 96% rename from registry/cache/monitoring.go rename to pkg/registry/cache/monitoring.go index f57973ef01..bc75171f53 100644 --- a/registry/cache/monitoring.go +++ b/pkg/registry/cache/monitoring.go @@ -7,7 +7,7 @@ import ( "github.com/go-kit/kit/metrics/prometheus" stdprometheus "github.com/prometheus/client_golang/prometheus" - fluxmetrics "github.com/fluxcd/flux/metrics" + fluxmetrics "github.com/fluxcd/flux/pkg/metrics" ) var ( diff --git a/registry/cache/registry.go b/pkg/registry/cache/registry.go similarity index 97% rename from registry/cache/registry.go rename to pkg/registry/cache/registry.go index 3a6c9edcc2..850f8d8e6a 100644 --- a/registry/cache/registry.go +++ b/pkg/registry/cache/registry.go @@ -7,9 +7,9 @@ import ( "github.com/pkg/errors" "github.com/ryanuber/go-glob" - fluxerr "github.com/fluxcd/flux/errors" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/registry" + fluxerr "github.com/fluxcd/flux/pkg/errors" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/registry" ) var ( diff --git a/registry/cache/registry_test.go b/pkg/registry/cache/registry_test.go similarity index 96% rename from registry/cache/registry_test.go rename to pkg/registry/cache/registry_test.go index 8c8203bcd7..708bb1cdbd 100644 --- a/registry/cache/registry_test.go +++ b/pkg/registry/cache/registry_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" + "github.com/fluxcd/flux/pkg/image" "github.com/stretchr/testify/assert" - "github.com/fluxcd/flux/image" ) // mockStorage holds a fixed ImageRepository item. @@ -36,7 +36,7 @@ func mockReader() *mockStorage { return &mockStorage{ Item: ImageRepository{ RepositoryMetadata: image.RepositoryMetadata{ - Tags: []string{}, + Tags: []string{}, Images: map[string]image.Info{}, }, LastUpdate: time.Now(), diff --git a/registry/cache/repocachemanager.go b/pkg/registry/cache/repocachemanager.go similarity index 99% rename from registry/cache/repocachemanager.go rename to pkg/registry/cache/repocachemanager.go index 526339f097..948479e242 100644 --- a/registry/cache/repocachemanager.go +++ b/pkg/registry/cache/repocachemanager.go @@ -12,8 +12,8 @@ import ( "github.com/go-kit/kit/log" "github.com/pkg/errors" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/registry" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/registry" ) type imageToUpdate struct { diff --git a/registry/cache/repocachemanager_test.go b/pkg/registry/cache/repocachemanager_test.go similarity index 93% rename from registry/cache/repocachemanager_test.go rename to pkg/registry/cache/repocachemanager_test.go index 802139dcfc..d7434141be 100644 --- a/registry/cache/repocachemanager_test.go +++ b/pkg/registry/cache/repocachemanager_test.go @@ -12,8 +12,8 @@ import ( "github.com/go-kit/kit/log" "github.com/stretchr/testify/assert" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/registry" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/registry" ) func Test_ClientTimeouts(t *testing.T) { diff --git a/registry/cache/warming.go b/pkg/registry/cache/warming.go similarity index 99% rename from registry/cache/warming.go rename to pkg/registry/cache/warming.go index 1e2666fc05..4184691173 100644 --- a/registry/cache/warming.go +++ b/pkg/registry/cache/warming.go @@ -9,8 +9,8 @@ import ( "github.com/go-kit/kit/log" "github.com/pkg/errors" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/registry" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/registry" ) const askForNewImagesInterval = time.Minute diff --git a/registry/cache/warming_test.go b/pkg/registry/cache/warming_test.go similarity index 97% rename from registry/cache/warming_test.go rename to pkg/registry/cache/warming_test.go index 8a8a147631..2d6575aa8e 100644 --- a/registry/cache/warming_test.go +++ b/pkg/registry/cache/warming_test.go @@ -10,9 +10,9 @@ import ( "github.com/go-kit/kit/log" "github.com/stretchr/testify/assert" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/registry" - "github.com/fluxcd/flux/registry/mock" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/registry" + "github.com/fluxcd/flux/pkg/registry/mock" ) type entry struct { diff --git a/registry/client.go b/pkg/registry/client.go similarity index 99% rename from registry/client.go rename to pkg/registry/client.go index 9e256a36d3..44f80d572c 100644 --- a/registry/client.go +++ b/pkg/registry/client.go @@ -15,7 +15,7 @@ import ( "github.com/docker/distribution/registry/client" "github.com/opencontainers/go-digest" - "github.com/fluxcd/flux/image" + "github.com/fluxcd/flux/pkg/image" ) type Excluded struct { diff --git a/registry/client_factory.go b/pkg/registry/client_factory.go similarity index 98% rename from registry/client_factory.go rename to pkg/registry/client_factory.go index 12a131e3da..2935a7f35b 100644 --- a/registry/client_factory.go +++ b/pkg/registry/client_factory.go @@ -14,8 +14,8 @@ import ( "github.com/docker/distribution/registry/client/transport" "github.com/go-kit/kit/log" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/registry/middleware" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/registry/middleware" ) type RemoteClientFactory struct { diff --git a/registry/credentials.go b/pkg/registry/credentials.go similarity index 100% rename from registry/credentials.go rename to pkg/registry/credentials.go diff --git a/registry/credentials_test.go b/pkg/registry/credentials_test.go similarity index 100% rename from registry/credentials_test.go rename to pkg/registry/credentials_test.go diff --git a/registry/doc.go b/pkg/registry/doc.go similarity index 100% rename from registry/doc.go rename to pkg/registry/doc.go diff --git a/registry/gcp.go b/pkg/registry/gcp.go similarity index 100% rename from registry/gcp.go rename to pkg/registry/gcp.go diff --git a/registry/imageentry_test.go b/pkg/registry/imageentry_test.go similarity index 97% rename from registry/imageentry_test.go rename to pkg/registry/imageentry_test.go index 9e37f271dd..e464d25170 100644 --- a/registry/imageentry_test.go +++ b/pkg/registry/imageentry_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/fluxcd/flux/image" + "github.com/fluxcd/flux/pkg/image" ) // Check that the ImageEntry type can be round-tripped via JSON. diff --git a/registry/middleware/rate_limiter.go b/pkg/registry/middleware/rate_limiter.go similarity index 100% rename from registry/middleware/rate_limiter.go rename to pkg/registry/middleware/rate_limiter.go diff --git a/registry/mock/mock.go b/pkg/registry/mock/mock.go similarity index 95% rename from registry/mock/mock.go rename to pkg/registry/mock/mock.go index 48fb7cb5fd..94b014ee48 100644 --- a/registry/mock/mock.go +++ b/pkg/registry/mock/mock.go @@ -5,8 +5,8 @@ import ( "github.com/pkg/errors" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/registry" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/registry" ) type Client struct { diff --git a/registry/monitoring.go b/pkg/registry/monitoring.go similarity index 96% rename from registry/monitoring.go rename to pkg/registry/monitoring.go index bdca062c41..5f31b18dcb 100644 --- a/registry/monitoring.go +++ b/pkg/registry/monitoring.go @@ -10,8 +10,8 @@ import ( "github.com/go-kit/kit/metrics/prometheus" stdprometheus "github.com/prometheus/client_golang/prometheus" - "github.com/fluxcd/flux/image" - fluxmetrics "github.com/fluxcd/flux/metrics" + "github.com/fluxcd/flux/pkg/image" + fluxmetrics "github.com/fluxcd/flux/pkg/metrics" ) const ( diff --git a/registry/registry.go b/pkg/registry/registry.go similarity index 92% rename from registry/registry.go rename to pkg/registry/registry.go index 100cbab9f4..4bec69e52c 100644 --- a/registry/registry.go +++ b/pkg/registry/registry.go @@ -3,7 +3,7 @@ package registry import ( "errors" - "github.com/fluxcd/flux/image" + "github.com/fluxcd/flux/pkg/image" ) var ( diff --git a/release/context.go b/pkg/release/context.go similarity index 95% rename from release/context.go rename to pkg/release/context.go index 1dfff5c0c6..38a37b6e71 100644 --- a/release/context.go +++ b/pkg/release/context.go @@ -6,11 +6,11 @@ import ( "github.com/pkg/errors" - "github.com/fluxcd/flux/cluster" - "github.com/fluxcd/flux/manifests" - "github.com/fluxcd/flux/registry" - "github.com/fluxcd/flux/resource" - "github.com/fluxcd/flux/update" + "github.com/fluxcd/flux/pkg/cluster" + "github.com/fluxcd/flux/pkg/manifests" + "github.com/fluxcd/flux/pkg/registry" + "github.com/fluxcd/flux/pkg/resource" + "github.com/fluxcd/flux/pkg/update" ) type ReleaseContext struct { diff --git a/release/errors.go b/pkg/release/errors.go similarity index 86% rename from release/errors.go rename to pkg/release/errors.go index d453d26e66..0877bce68e 100644 --- a/release/errors.go +++ b/pkg/release/errors.go @@ -1,7 +1,7 @@ package release import ( - fluxerr "github.com/fluxcd/flux/errors" + fluxerr "github.com/fluxcd/flux/pkg/errors" ) func MakeReleaseError(err error) *fluxerr.Error { @@ -21,7 +21,7 @@ for those limitations. If your files appear to meet the requirements, it may simply be a bug in Flux. Please report it at - https://github.com/fluxcd/flux/issues + https://github.com/fluxcd/flux/pkg/issues and try to include the problematic manifest, if it can be identified. `, diff --git a/release/releaser.go b/pkg/release/releaser.go similarity index 98% rename from release/releaser.go rename to pkg/release/releaser.go index 02b94fbb40..d2691b871c 100644 --- a/release/releaser.go +++ b/pkg/release/releaser.go @@ -9,8 +9,8 @@ import ( "github.com/go-kit/kit/log" "github.com/pkg/errors" - "github.com/fluxcd/flux/resource" - "github.com/fluxcd/flux/update" + "github.com/fluxcd/flux/pkg/resource" + "github.com/fluxcd/flux/pkg/update" ) type Changes interface { diff --git a/release/releaser_test.go b/pkg/release/releaser_test.go similarity index 98% rename from release/releaser_test.go rename to pkg/release/releaser_test.go index 4cc9b2bbf6..f63c021f5c 100644 --- a/release/releaser_test.go +++ b/pkg/release/releaser_test.go @@ -13,16 +13,16 @@ import ( "github.com/stretchr/testify/assert" - "github.com/fluxcd/flux/cluster" - "github.com/fluxcd/flux/cluster/kubernetes" - "github.com/fluxcd/flux/cluster/mock" - "github.com/fluxcd/flux/git" - "github.com/fluxcd/flux/git/gittest" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/manifests" - registryMock "github.com/fluxcd/flux/registry/mock" - "github.com/fluxcd/flux/resource" - "github.com/fluxcd/flux/update" + "github.com/fluxcd/flux/pkg/cluster" + "github.com/fluxcd/flux/pkg/cluster/kubernetes" + "github.com/fluxcd/flux/pkg/cluster/mock" + "github.com/fluxcd/flux/pkg/git" + "github.com/fluxcd/flux/pkg/git/gittest" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/manifests" + registryMock "github.com/fluxcd/flux/pkg/registry/mock" + "github.com/fluxcd/flux/pkg/resource" + "github.com/fluxcd/flux/pkg/update" ) var ( diff --git a/remote/doc.go b/pkg/remote/doc.go similarity index 100% rename from remote/doc.go rename to pkg/remote/doc.go diff --git a/remote/errors.go b/pkg/remote/errors.go similarity index 93% rename from remote/errors.go rename to pkg/remote/errors.go index 76c40049cd..e673ebc1ac 100644 --- a/remote/errors.go +++ b/pkg/remote/errors.go @@ -1,7 +1,7 @@ package remote import ( - fluxerr "github.com/fluxcd/flux/errors" + fluxerr "github.com/fluxcd/flux/pkg/errors" ) func UnavailableError(err error) error { @@ -26,7 +26,7 @@ documentation: If you are still stuck, please log an issue: - https://github.com/fluxcd/flux/issues + https://github.com/fluxcd/flux/pkg/issues `, Err: err, @@ -61,7 +61,7 @@ the following kinds of pod controller: Deployments, DaemonSets, StatefulSets and CronJobs. When new kinds are added to Kubernetes, we try to support them as quickly as possible - check here to see if a new version of Flux is available: - https://github.com/fluxcd/flux/releases + https://github.com/fluxcd/flux/pkg/releases Releasing by Service is not supported - if you're using an old version of fluxctl that accepts the '--service' argument you will need to get a new one @@ -93,7 +93,7 @@ instructions: If you are still stuck, please log an issue: - https://github.com/fluxcd/flux/issues + https://github.com/fluxcd/flux/pkg/issues `, Err: err, diff --git a/remote/logging.go b/pkg/remote/logging.go similarity index 92% rename from remote/logging.go rename to pkg/remote/logging.go index 2e208d1cc5..0c6578376a 100644 --- a/remote/logging.go +++ b/pkg/remote/logging.go @@ -5,13 +5,13 @@ import ( "github.com/go-kit/kit/log" - "github.com/fluxcd/flux/api" - "github.com/fluxcd/flux/api/v10" - "github.com/fluxcd/flux/api/v11" - "github.com/fluxcd/flux/api/v6" - "github.com/fluxcd/flux/api/v9" - "github.com/fluxcd/flux/job" - "github.com/fluxcd/flux/update" + "github.com/fluxcd/flux/pkg/api" + "github.com/fluxcd/flux/pkg/api/v10" + "github.com/fluxcd/flux/pkg/api/v11" + "github.com/fluxcd/flux/pkg/api/v6" + "github.com/fluxcd/flux/pkg/api/v9" + "github.com/fluxcd/flux/pkg/job" + "github.com/fluxcd/flux/pkg/update" ) var _ api.Server = &ErrorLoggingServer{} diff --git a/remote/metrics.go b/pkg/remote/metrics.go similarity index 94% rename from remote/metrics.go rename to pkg/remote/metrics.go index 7d14cd3aee..5fe0cb2a77 100644 --- a/remote/metrics.go +++ b/pkg/remote/metrics.go @@ -8,14 +8,14 @@ import ( "github.com/go-kit/kit/metrics/prometheus" stdprometheus "github.com/prometheus/client_golang/prometheus" - "github.com/fluxcd/flux/api" - "github.com/fluxcd/flux/api/v10" - "github.com/fluxcd/flux/api/v11" - "github.com/fluxcd/flux/api/v6" - "github.com/fluxcd/flux/api/v9" - "github.com/fluxcd/flux/job" - fluxmetrics "github.com/fluxcd/flux/metrics" - "github.com/fluxcd/flux/update" + "github.com/fluxcd/flux/pkg/api" + "github.com/fluxcd/flux/pkg/api/v10" + "github.com/fluxcd/flux/pkg/api/v11" + "github.com/fluxcd/flux/pkg/api/v6" + "github.com/fluxcd/flux/pkg/api/v9" + "github.com/fluxcd/flux/pkg/job" + fluxmetrics "github.com/fluxcd/flux/pkg/metrics" + "github.com/fluxcd/flux/pkg/update" ) var ( diff --git a/remote/mock.go b/pkg/remote/mock.go similarity index 94% rename from remote/mock.go rename to pkg/remote/mock.go index 83506c9307..61ebd396b1 100644 --- a/remote/mock.go +++ b/pkg/remote/mock.go @@ -8,16 +8,16 @@ import ( "testing" "time" - "github.com/fluxcd/flux/api" - "github.com/fluxcd/flux/api/v10" - "github.com/fluxcd/flux/api/v11" - "github.com/fluxcd/flux/api/v6" - "github.com/fluxcd/flux/api/v9" - "github.com/fluxcd/flux/guid" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/job" - "github.com/fluxcd/flux/resource" - "github.com/fluxcd/flux/update" + "github.com/fluxcd/flux/pkg/api" + "github.com/fluxcd/flux/pkg/api/v10" + "github.com/fluxcd/flux/pkg/api/v11" + "github.com/fluxcd/flux/pkg/api/v6" + "github.com/fluxcd/flux/pkg/api/v9" + "github.com/fluxcd/flux/pkg/guid" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/job" + "github.com/fluxcd/flux/pkg/resource" + "github.com/fluxcd/flux/pkg/update" ) type MockServer struct { diff --git a/remote/mock_test.go b/pkg/remote/mock_test.go similarity index 84% rename from remote/mock_test.go rename to pkg/remote/mock_test.go index cfa10f882c..696206f233 100644 --- a/remote/mock_test.go +++ b/pkg/remote/mock_test.go @@ -3,7 +3,7 @@ package remote import ( "testing" - "github.com/fluxcd/flux/api" + "github.com/fluxcd/flux/pkg/api" ) // Just test that the mock does its job. diff --git a/remote/rpc/baseclient.go b/pkg/remote/rpc/baseclient.go similarity index 88% rename from remote/rpc/baseclient.go rename to pkg/remote/rpc/baseclient.go index 4b48d47cb3..02dc3ae23c 100644 --- a/remote/rpc/baseclient.go +++ b/pkg/remote/rpc/baseclient.go @@ -5,14 +5,14 @@ import ( "github.com/pkg/errors" - "github.com/fluxcd/flux/api" - "github.com/fluxcd/flux/api/v10" - "github.com/fluxcd/flux/api/v11" - "github.com/fluxcd/flux/api/v6" - "github.com/fluxcd/flux/api/v9" - "github.com/fluxcd/flux/job" - "github.com/fluxcd/flux/remote" - "github.com/fluxcd/flux/update" + "github.com/fluxcd/flux/pkg/api" + "github.com/fluxcd/flux/pkg/api/v10" + "github.com/fluxcd/flux/pkg/api/v11" + "github.com/fluxcd/flux/pkg/api/v6" + "github.com/fluxcd/flux/pkg/api/v9" + "github.com/fluxcd/flux/pkg/job" + "github.com/fluxcd/flux/pkg/remote" + "github.com/fluxcd/flux/pkg/update" ) type baseClient struct{} diff --git a/remote/rpc/clientV10.go b/pkg/remote/rpc/clientV10.go similarity index 91% rename from remote/rpc/clientV10.go rename to pkg/remote/rpc/clientV10.go index d4a5769464..35b062a734 100644 --- a/remote/rpc/clientV10.go +++ b/pkg/remote/rpc/clientV10.go @@ -5,9 +5,9 @@ import ( "io" "net/rpc" - "github.com/fluxcd/flux/api/v10" - "github.com/fluxcd/flux/api/v6" - "github.com/fluxcd/flux/remote" + "github.com/fluxcd/flux/pkg/api/v10" + "github.com/fluxcd/flux/pkg/api/v6" + "github.com/fluxcd/flux/pkg/remote" ) // RPCClientV10 is the rpc-backed implementation of a server, for diff --git a/remote/rpc/clientV11.go b/pkg/remote/rpc/clientV11.go similarity index 91% rename from remote/rpc/clientV11.go rename to pkg/remote/rpc/clientV11.go index 15da88ff75..c1c4f34d05 100644 --- a/remote/rpc/clientV11.go +++ b/pkg/remote/rpc/clientV11.go @@ -5,9 +5,9 @@ import ( "io" "net/rpc" - "github.com/fluxcd/flux/api/v11" - "github.com/fluxcd/flux/api/v6" - "github.com/fluxcd/flux/remote" + "github.com/fluxcd/flux/pkg/api/v11" + "github.com/fluxcd/flux/pkg/api/v6" + "github.com/fluxcd/flux/pkg/remote" ) // RPCClientV11 is the rpc-backed implementation of a server, for diff --git a/remote/rpc/clientV6.go b/pkg/remote/rpc/clientV6.go similarity index 95% rename from remote/rpc/clientV6.go rename to pkg/remote/rpc/clientV6.go index 4f75e3fe05..80b9b51877 100644 --- a/remote/rpc/clientV6.go +++ b/pkg/remote/rpc/clientV6.go @@ -6,13 +6,13 @@ import ( "net/rpc" "net/rpc/jsonrpc" - "github.com/fluxcd/flux/api/v10" - "github.com/fluxcd/flux/api/v11" - "github.com/fluxcd/flux/api/v6" - fluxerr "github.com/fluxcd/flux/errors" - "github.com/fluxcd/flux/job" - "github.com/fluxcd/flux/remote" - "github.com/fluxcd/flux/update" + "github.com/fluxcd/flux/pkg/api/v10" + "github.com/fluxcd/flux/pkg/api/v11" + "github.com/fluxcd/flux/pkg/api/v6" + fluxerr "github.com/fluxcd/flux/pkg/errors" + "github.com/fluxcd/flux/pkg/job" + "github.com/fluxcd/flux/pkg/remote" + "github.com/fluxcd/flux/pkg/update" ) // RPCClient is the rpc-backed implementation of a server, for diff --git a/remote/rpc/clientV7.go b/pkg/remote/rpc/clientV7.go similarity index 94% rename from remote/rpc/clientV7.go rename to pkg/remote/rpc/clientV7.go index 3cf5130342..264a01650c 100644 --- a/remote/rpc/clientV7.go +++ b/pkg/remote/rpc/clientV7.go @@ -5,13 +5,13 @@ import ( "io" "net/rpc" - "github.com/fluxcd/flux/api/v10" - "github.com/fluxcd/flux/api/v11" - "github.com/fluxcd/flux/api/v6" - fluxerr "github.com/fluxcd/flux/errors" - "github.com/fluxcd/flux/job" - "github.com/fluxcd/flux/remote" - "github.com/fluxcd/flux/update" + "github.com/fluxcd/flux/pkg/api/v10" + "github.com/fluxcd/flux/pkg/api/v11" + "github.com/fluxcd/flux/pkg/api/v6" + fluxerr "github.com/fluxcd/flux/pkg/errors" + "github.com/fluxcd/flux/pkg/job" + "github.com/fluxcd/flux/pkg/remote" + "github.com/fluxcd/flux/pkg/update" ) // RPCClient is the rpc-backed implementation of a server, for diff --git a/remote/rpc/clientV8.go b/pkg/remote/rpc/clientV8.go similarity index 90% rename from remote/rpc/clientV8.go rename to pkg/remote/rpc/clientV8.go index 1b601f110d..3db8a38ed5 100644 --- a/remote/rpc/clientV8.go +++ b/pkg/remote/rpc/clientV8.go @@ -5,12 +5,12 @@ import ( "io" "net/rpc" - "github.com/fluxcd/flux/api/v10" - "github.com/fluxcd/flux/api/v11" - "github.com/fluxcd/flux/api/v6" - "github.com/fluxcd/flux/job" - "github.com/fluxcd/flux/remote" - "github.com/fluxcd/flux/update" + "github.com/fluxcd/flux/pkg/api/v10" + "github.com/fluxcd/flux/pkg/api/v11" + "github.com/fluxcd/flux/pkg/api/v6" + "github.com/fluxcd/flux/pkg/job" + "github.com/fluxcd/flux/pkg/remote" + "github.com/fluxcd/flux/pkg/update" ) // RPCClient is the rpc-backed implementation of a server, for diff --git a/remote/rpc/clientV9.go b/pkg/remote/rpc/clientV9.go similarity index 89% rename from remote/rpc/clientV9.go rename to pkg/remote/rpc/clientV9.go index 6e1d22243b..1f3c037162 100644 --- a/remote/rpc/clientV9.go +++ b/pkg/remote/rpc/clientV9.go @@ -5,8 +5,8 @@ import ( "io" "net/rpc" - "github.com/fluxcd/flux/api/v9" - "github.com/fluxcd/flux/remote" + "github.com/fluxcd/flux/pkg/api/v9" + "github.com/fluxcd/flux/pkg/remote" ) type RPCClientV9 struct { diff --git a/remote/rpc/compat.go b/pkg/remote/rpc/compat.go similarity index 94% rename from remote/rpc/compat.go rename to pkg/remote/rpc/compat.go index 18bdaae367..561c705a30 100644 --- a/remote/rpc/compat.go +++ b/pkg/remote/rpc/compat.go @@ -5,15 +5,15 @@ import ( "errors" "fmt" - "github.com/fluxcd/flux/api/v10" - "github.com/fluxcd/flux/api/v11" - "github.com/fluxcd/flux/api/v6" - "github.com/fluxcd/flux/cluster" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/policy" - "github.com/fluxcd/flux/remote" - "github.com/fluxcd/flux/resource" - "github.com/fluxcd/flux/update" + "github.com/fluxcd/flux/pkg/api/v10" + "github.com/fluxcd/flux/pkg/api/v11" + "github.com/fluxcd/flux/pkg/api/v6" + "github.com/fluxcd/flux/pkg/cluster" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/policy" + "github.com/fluxcd/flux/pkg/remote" + "github.com/fluxcd/flux/pkg/resource" + "github.com/fluxcd/flux/pkg/update" ) func requireServiceSpecKinds(ss update.ResourceSpec, kinds []string) error { diff --git a/remote/rpc/doc.go b/pkg/remote/rpc/doc.go similarity index 100% rename from remote/rpc/doc.go rename to pkg/remote/rpc/doc.go diff --git a/remote/rpc/rpc_test.go b/pkg/remote/rpc/rpc_test.go similarity index 95% rename from remote/rpc/rpc_test.go rename to pkg/remote/rpc/rpc_test.go index 022ce19cb4..c88045cfab 100644 --- a/remote/rpc/rpc_test.go +++ b/pkg/remote/rpc/rpc_test.go @@ -8,8 +8,8 @@ import ( "testing" "time" - "github.com/fluxcd/flux/api" - "github.com/fluxcd/flux/remote" + "github.com/fluxcd/flux/pkg/api" + "github.com/fluxcd/flux/pkg/remote" ) func pipes() (io.ReadWriteCloser, io.ReadWriteCloser) { diff --git a/remote/rpc/server.go b/pkg/remote/rpc/server.go similarity index 95% rename from remote/rpc/server.go rename to pkg/remote/rpc/server.go index 1f3bafd628..7f38250f84 100644 --- a/remote/rpc/server.go +++ b/pkg/remote/rpc/server.go @@ -7,16 +7,16 @@ import ( "net/rpc/jsonrpc" "time" - "github.com/fluxcd/flux/api/v10" + "github.com/fluxcd/flux/pkg/api/v10" "github.com/pkg/errors" - "github.com/fluxcd/flux/api" - "github.com/fluxcd/flux/api/v6" - "github.com/fluxcd/flux/api/v9" - fluxerr "github.com/fluxcd/flux/errors" - "github.com/fluxcd/flux/job" - "github.com/fluxcd/flux/update" + "github.com/fluxcd/flux/pkg/api" + "github.com/fluxcd/flux/pkg/api/v6" + "github.com/fluxcd/flux/pkg/api/v9" + fluxerr "github.com/fluxcd/flux/pkg/errors" + "github.com/fluxcd/flux/pkg/job" + "github.com/fluxcd/flux/pkg/update" ) // Server takes an api.Server and makes it available over RPC. diff --git a/resource/id.go b/pkg/resource/id.go similarity index 100% rename from resource/id.go rename to pkg/resource/id.go diff --git a/resource/id_test.go b/pkg/resource/id_test.go similarity index 100% rename from resource/id_test.go rename to pkg/resource/id_test.go diff --git a/resource/policy.go b/pkg/resource/policy.go similarity index 97% rename from resource/policy.go rename to pkg/resource/policy.go index 0427f0d89b..7bb1a13da9 100644 --- a/resource/policy.go +++ b/pkg/resource/policy.go @@ -3,7 +3,7 @@ package resource import ( "fmt" - "github.com/fluxcd/flux/policy" + "github.com/fluxcd/flux/pkg/policy" ) // ChangeForPolicyUpdate evaluates a policy update with respect to a @@ -52,4 +52,3 @@ type PolicyUpdate struct { Add policy.Set `json:"add"` Remove policy.Set `json:"remove"` } - diff --git a/resource/resource.go b/pkg/resource/resource.go similarity index 91% rename from resource/resource.go rename to pkg/resource/resource.go index 5b41f04a96..74c8955dce 100644 --- a/resource/resource.go +++ b/pkg/resource/resource.go @@ -1,8 +1,8 @@ package resource import ( - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/policy" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/policy" ) // For the minute we just care about diff --git a/ssh/keygen.go b/pkg/ssh/keygen.go similarity index 100% rename from ssh/keygen.go rename to pkg/ssh/keygen.go diff --git a/ssh/keyring.go b/pkg/ssh/keyring.go similarity index 100% rename from ssh/keyring.go rename to pkg/ssh/keyring.go diff --git a/sync/git.go b/pkg/sync/git.go similarity index 98% rename from sync/git.go rename to pkg/sync/git.go index e2821f56a1..d50babe9e4 100644 --- a/sync/git.go +++ b/pkg/sync/git.go @@ -4,7 +4,7 @@ import ( "context" "strings" - "github.com/fluxcd/flux/git" + "github.com/fluxcd/flux/pkg/git" ) // GitTagSyncProvider is the mechanism by which a Git tag is used to keep track of the current point fluxd has synced to. diff --git a/sync/mock.go b/pkg/sync/mock.go similarity index 92% rename from sync/mock.go rename to pkg/sync/mock.go index 5efc4aa439..5711d7e276 100644 --- a/sync/mock.go +++ b/pkg/sync/mock.go @@ -1,8 +1,8 @@ package sync import ( - "github.com/fluxcd/flux/policy" - "github.com/fluxcd/flux/resource" + "github.com/fluxcd/flux/pkg/policy" + "github.com/fluxcd/flux/pkg/resource" ) type rsc struct { diff --git a/sync/provider.go b/pkg/sync/provider.go similarity index 100% rename from sync/provider.go rename to pkg/sync/provider.go diff --git a/sync/secret.go b/pkg/sync/secret.go similarity index 100% rename from sync/secret.go rename to pkg/sync/secret.go diff --git a/sync/sync.go b/pkg/sync/sync.go similarity index 89% rename from sync/sync.go rename to pkg/sync/sync.go index 30328607b2..6a9f98fc3a 100644 --- a/sync/sync.go +++ b/pkg/sync/sync.go @@ -1,8 +1,8 @@ package sync import ( - "github.com/fluxcd/flux/cluster" - "github.com/fluxcd/flux/resource" + "github.com/fluxcd/flux/pkg/cluster" + "github.com/fluxcd/flux/pkg/resource" ) // Syncer has the methods we need to be able to compile and run a sync diff --git a/sync/sync_test.go b/pkg/sync/sync_test.go similarity index 89% rename from sync/sync_test.go rename to pkg/sync/sync_test.go index bc69f9cf47..a41eea232b 100644 --- a/sync/sync_test.go +++ b/pkg/sync/sync_test.go @@ -8,12 +8,12 @@ import ( "github.com/go-kit/kit/log" "github.com/stretchr/testify/assert" - "github.com/fluxcd/flux/cluster" - "github.com/fluxcd/flux/cluster/kubernetes" - "github.com/fluxcd/flux/git" - "github.com/fluxcd/flux/git/gittest" - "github.com/fluxcd/flux/manifests" - "github.com/fluxcd/flux/resource" + "github.com/fluxcd/flux/pkg/cluster" + "github.com/fluxcd/flux/pkg/cluster/kubernetes" + "github.com/fluxcd/flux/pkg/git" + "github.com/fluxcd/flux/pkg/git/gittest" + "github.com/fluxcd/flux/pkg/manifests" + "github.com/fluxcd/flux/pkg/resource" ) // Test that cluster.Sync gets called with the appropriate things when diff --git a/update/automated.go b/pkg/update/automated.go similarity index 98% rename from update/automated.go rename to pkg/update/automated.go index 36a93baaa3..e7e2ae9654 100644 --- a/update/automated.go +++ b/pkg/update/automated.go @@ -7,8 +7,8 @@ import ( "github.com/go-kit/kit/log" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/resource" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/resource" ) type Automated struct { diff --git a/update/filter.go b/pkg/update/filter.go similarity index 95% rename from update/filter.go rename to pkg/update/filter.go index d065691d69..23ccd402e8 100644 --- a/update/filter.go +++ b/pkg/update/filter.go @@ -1,9 +1,9 @@ package update import ( - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/policy" - "github.com/fluxcd/flux/resource" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/policy" + "github.com/fluxcd/flux/pkg/resource" ) const ( diff --git a/update/images.go b/pkg/update/images.go similarity index 96% rename from update/images.go rename to pkg/update/images.go index 77b3e74247..523587d18a 100644 --- a/update/images.go +++ b/pkg/update/images.go @@ -7,11 +7,11 @@ import ( "github.com/go-kit/kit/log" "github.com/pkg/errors" - fluxerr "github.com/fluxcd/flux/errors" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/policy" - "github.com/fluxcd/flux/registry" - "github.com/fluxcd/flux/resource" + fluxerr "github.com/fluxcd/flux/pkg/errors" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/policy" + "github.com/fluxcd/flux/pkg/registry" + "github.com/fluxcd/flux/pkg/resource" ) type imageReposMap map[image.CanonicalName]image.RepositoryMetadata diff --git a/update/images_test.go b/pkg/update/images_test.go similarity index 97% rename from update/images_test.go rename to pkg/update/images_test.go index f577357104..3201d31e0d 100644 --- a/update/images_test.go +++ b/pkg/update/images_test.go @@ -6,9 +6,9 @@ import ( "github.com/stretchr/testify/assert" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/policy" - "github.com/fluxcd/flux/registry/mock" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/policy" + "github.com/fluxcd/flux/pkg/registry/mock" ) var ( diff --git a/update/menu.go b/pkg/update/menu.go similarity index 99% rename from update/menu.go rename to pkg/update/menu.go index 92807da4b4..d05e0ba8db 100644 --- a/update/menu.go +++ b/pkg/update/menu.go @@ -7,7 +7,7 @@ import ( "io" "text/tabwriter" - "github.com/fluxcd/flux/resource" + "github.com/fluxcd/flux/pkg/resource" ) const ( diff --git a/update/menu_unix.go b/pkg/update/menu_unix.go similarity index 100% rename from update/menu_unix.go rename to pkg/update/menu_unix.go diff --git a/update/menu_win.go b/pkg/update/menu_win.go similarity index 100% rename from update/menu_win.go rename to pkg/update/menu_win.go diff --git a/update/metrics.go b/pkg/update/metrics.go similarity index 96% rename from update/metrics.go rename to pkg/update/metrics.go index 85c8262968..3f8882e83f 100644 --- a/update/metrics.go +++ b/pkg/update/metrics.go @@ -4,10 +4,10 @@ import ( "fmt" "time" + fluxmetrics "github.com/fluxcd/flux/pkg/metrics" "github.com/go-kit/kit/metrics" "github.com/go-kit/kit/metrics/prometheus" stdprometheus "github.com/prometheus/client_golang/prometheus" - fluxmetrics "github.com/fluxcd/flux/metrics" ) var ( diff --git a/update/print.go b/pkg/update/print.go similarity index 100% rename from update/print.go rename to pkg/update/print.go diff --git a/update/print_test.go b/pkg/update/print_test.go similarity index 97% rename from update/print_test.go rename to pkg/update/print_test.go index 57b94f7fb4..38d4b5c62a 100644 --- a/update/print_test.go +++ b/pkg/update/print_test.go @@ -4,8 +4,8 @@ import ( "bytes" "testing" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/resource" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/resource" ) func mustParseRef(s string) image.Ref { diff --git a/update/release_containers.go b/pkg/update/release_containers.go similarity index 98% rename from update/release_containers.go rename to pkg/update/release_containers.go index e77ceedd1b..48bf00797c 100644 --- a/update/release_containers.go +++ b/pkg/update/release_containers.go @@ -9,8 +9,8 @@ import ( "github.com/go-kit/kit/log" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/resource" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/resource" ) var zeroImageRef = image.Ref{} diff --git a/update/release_image.go b/pkg/update/release_image.go similarity index 98% rename from update/release_image.go rename to pkg/update/release_image.go index 08c32c9dc5..bb4f50c967 100644 --- a/update/release_image.go +++ b/pkg/update/release_image.go @@ -7,11 +7,11 @@ import ( "github.com/pkg/errors" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/policy" + "github.com/fluxcd/flux/pkg/registry" + "github.com/fluxcd/flux/pkg/resource" "github.com/go-kit/kit/log" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/policy" - "github.com/fluxcd/flux/registry" - "github.com/fluxcd/flux/resource" ) const ( diff --git a/update/result.go b/pkg/update/result.go similarity index 96% rename from update/result.go rename to pkg/update/result.go index 48305ff83e..2a8912cd48 100644 --- a/update/result.go +++ b/pkg/update/result.go @@ -5,8 +5,8 @@ import ( "sort" "strings" - "github.com/fluxcd/flux/image" - "github.com/fluxcd/flux/resource" + "github.com/fluxcd/flux/pkg/image" + "github.com/fluxcd/flux/pkg/resource" ) type WorkloadUpdateStatus string diff --git a/update/spec.go b/pkg/update/spec.go similarity index 97% rename from update/spec.go rename to pkg/update/spec.go index ad747fa193..07c099ee5e 100644 --- a/update/spec.go +++ b/pkg/update/spec.go @@ -4,7 +4,7 @@ import ( "encoding/json" "errors" - "github.com/fluxcd/flux/resource" + "github.com/fluxcd/flux/pkg/resource" ) const ( diff --git a/update/spec_test.go b/pkg/update/spec_test.go similarity index 100% rename from update/spec_test.go rename to pkg/update/spec_test.go diff --git a/update/sync.go b/pkg/update/sync.go similarity index 100% rename from update/sync.go rename to pkg/update/sync.go diff --git a/update/workload.go b/pkg/update/workload.go similarity index 85% rename from update/workload.go rename to pkg/update/workload.go index 5ba28096f6..f58ce03b1f 100644 --- a/update/workload.go +++ b/pkg/update/workload.go @@ -1,8 +1,8 @@ package update import ( - "github.com/fluxcd/flux/cluster" - "github.com/fluxcd/flux/resource" + "github.com/fluxcd/flux/pkg/cluster" + "github.com/fluxcd/flux/pkg/resource" ) type WorkloadUpdate struct {