Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Apply all resources in a single kubectl call #872

Merged
merged 19 commits into from
Jan 2, 2018
Merged

Commits on Dec 21, 2017

  1. Remove namespace flag from kubectl apply/delete calls

    Since the namespace must be specified in the parsed manifest for us to retrieve
    it, we don't need to set this flag. Kubectl figures it out on its own.
    Sam Broughton committed Dec 21, 2017
    Configuration menu
    Copy the full SHA
    a5f18ff View commit details
    Browse the repository at this point in the history
  2. Remove unused apiObject fields

    Sam Broughton committed Dec 21, 2017
    Configuration menu
    Copy the full SHA
    5bd8f40 View commit details
    Browse the repository at this point in the history
  3. Remove Stdout/err fields from Kubectl struct

    These values are never actually used. They look like they are, but their only
    usage is immediately reassigned.
    Sam Broughton committed Dec 21, 2017
    Configuration menu
    Copy the full SHA
    40b23d5 View commit details
    Browse the repository at this point in the history
  4. Modify Applier to stage and execute rather than execute directly

    This change to the interface facilitates creating an Applier that combines all
    yamels into a multidoc to be applied in one call to kubectl.
    
    Note that the deleted test was testing behaviour that exists nowhere in flux.
    All references to `SyncAction` in the code contain only a single change, so the
    test was unnecessary.
    Sam Broughton committed Dec 21, 2017
    Configuration menu
    Copy the full SHA
    e7544db View commit details
    Browse the repository at this point in the history
  5. Accept []byte instead of *apiObject in Applier methods

    Since the namespace flag is no longer needed for kubectl, and since the tests
    don't actually need the object name, we can pass a byte slice and simplify a
    bit.
    
    This change guides us towards doing the single mega-apply without smushing bytes
    into an apiObject in a kludgey way.
    Sam Broughton committed Dec 21, 2017
    Configuration menu
    Copy the full SHA
    5bfc279 View commit details
    Browse the repository at this point in the history

Commits on Dec 22, 2017

  1. Replace actionc with a mutex

    As much as I love finding places to put channels, in this case it is entirely
    unnecessary. The only use of actionc can be replaced with a mutex, and any
    future methods can just compete for the lock instead of competing for a channel
    write.
    Sam Broughton committed Dec 22, 2017
    Configuration menu
    Copy the full SHA
    92e60a8 View commit details
    Browse the repository at this point in the history
  2. Store staged objects in a slice rather than a map

    This brings back the previous ordering without doing a sort. Since we no longer
    apply objects one at a time, we don't need an id.
    Sam Broughton committed Dec 22, 2017
    Configuration menu
    Copy the full SHA
    0a6ef34 View commit details
    Browse the repository at this point in the history
  3. Replace delete and apply with doCommand

    Sam Broughton committed Dec 22, 2017
    Configuration menu
    Copy the full SHA
    8419cc3 View commit details
    Browse the repository at this point in the history
  4. Deduplicate delete/apply logic

    Sam Broughton committed Dec 22, 2017
    Configuration menu
    Copy the full SHA
    687b704 View commit details
    Browse the repository at this point in the history
  5. Remove command order test

    This command was simply testing the mock.
    Sam Broughton committed Dec 22, 2017
    Configuration menu
    Copy the full SHA
    3000dcd View commit details
    Browse the repository at this point in the history
  6. Fallback to applying yamels one-by-one if mass apply fails

    Sam Broughton committed Dec 22, 2017
    Configuration menu
    Copy the full SHA
    7dbbd58 View commit details
    Browse the repository at this point in the history
  7. Remove mockClientSet noise

    We have this enormous block of nothingness all for satisying the requirements of
    a constructor we don't even need to use.
    Sam Broughton committed Dec 22, 2017
    Configuration menu
    Copy the full SHA
    1d010ee View commit details
    Browse the repository at this point in the history
  8. Remove error return value from NewCluster

    Sam Broughton committed Dec 22, 2017
    Configuration menu
    Copy the full SHA
    23c53d4 View commit details
    Browse the repository at this point in the history
  9. Camelify image_creds in main.go

    Sam Broughton committed Dec 22, 2017
    Configuration menu
    Copy the full SHA
    ab35632 View commit details
    Browse the repository at this point in the history
  10. Apply namespaceless objects to default namespace

    In some not-so-well-defined cases, applying an object to the default namespace
    can fail when its yaml doesn't explicitly specify the namespace. The simplest
    way to overcome this is to separate them out and pass the namespace flag to
    kubectl.
    Sam Broughton committed Dec 22, 2017
    Configuration menu
    Copy the full SHA
    712ca94 View commit details
    Browse the repository at this point in the history
  11. Factor out common bits of execute

    Sam Broughton committed Dec 22, 2017
    Configuration menu
    Copy the full SHA
    68db839 View commit details
    Browse the repository at this point in the history

Commits on Dec 28, 2017

  1. Remove namespace filtering logic from sync package

    The ordering of application/deletion of namespaces before/after namespaced
    resources is specific to kubernetes and so does not belong in the generic sync
    package. This ordering is now implicitly handled by the order in which commands
    are run in the kubernetes package.
    Sam Broughton committed Dec 28, 2017
    Configuration menu
    Copy the full SHA
    f74fd75 View commit details
    Browse the repository at this point in the history
  2. Remove state from kubectl struct

    It occurred to me that there's no good reason this state should be stored within
    the struct that happens to implement the Applier interface. The state can be
    built in the Sync method and then garbage collected at the end.
    Sam Broughton committed Dec 28, 2017
    Configuration menu
    Copy the full SHA
    c113bd1 View commit details
    Browse the repository at this point in the history

Commits on Jan 2, 2018

  1. Take cluster lock as late as possible

    Sam Broughton committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    8c3f720 View commit details
    Browse the repository at this point in the history