This project is mirrored from https://gitee.com/mirrors/nomad.git. Pull mirroring failed .
Repository mirroring has been paused due to too many failed attempts. It can be resumed by a project maintainer.
  1. 19 Aug, 2022 2 commits
  2. 18 Aug, 2022 8 commits
    • Michael Schurter's avatar
      client: fix data races in config handling (#14139) · 01648e61
      Michael Schurter authored
      Before this change, Client had 2 copies of the config object: config and configCopy. There was no guidance around which to use where (other than configCopy's comment to pass it to alloc runners), both are shared among goroutines and mutated in data racy ways. At least at one point I think the idea was to have `config` be mutable and then grab a lock to overwrite `configCopy`'s pointer atomically. This would have allowed alloc runners to read their config copies in data race safe ways, but this isn't how the current implementation worked.
      
      This change takes the following approach to safely handling configs in the client:
      
      1. `Client.config` is the only copy of the config and all access must go through the `Client.configLock` mutex
      2. Since the mutex *only protects the config pointer itself and not fields inside the Config struct:* all config mutation must be done on a *copy* of the config, and then Client's config pointer is overwritten while the mutex is acquired. Alloc runners and other goroutines with the old config pointer will not see config updates.
      3. Deep copying is implemented on the Config struct to satisfy the previous approach. The TLS Keyloader is an exception because it has its own internal locking to support mutating in place. An unfortunate complication but one I couldn't find a way to untangle in a timely fashion.
      4. To facilitate deep copying I made an *internally backward incompatible API change:* our `helper/funcs` used to turn containers (slices and maps) with 0 elements into nils. This probably saves a few memory allocations but makes it very easy to cause panics. Since my new config handling approach uses more copying, it became very difficult to ensure all code that used containers on configs could handle nils properly. Since this code has caused panics in the past, I fixed it: nil containers are copied as nil, but 0-element containers properly return a new 0-element container. No more "downgrading to nil!"
      01648e61
    • Derek Strickland's avatar
      sentinel: add support for Nomad ACL Token and Namespace (#14171) · a67bdd14
      Derek Strickland authored
      * sentinel: add ability to reference Nomad ACL Token and Namespace in Sentinel policies
      a67bdd14
    • Michael Schurter's avatar
      3de691a4
    • Seth Hoenig's avatar
      Merge pull request #14187 from hashicorp/f-print-correct-go-version-windows-circle · c5f5ba79
      Seth Hoenig authored
      build: print installed go version in cricle on windows
      c5f5ba79
    • Seth Hoenig's avatar
      build: print installed go version in cricle on windows · c3d024e7
      Seth Hoenig authored
      This PR fixes the circle workflow step on windows where we print
      the go version. Like the other commands that use Go, we must
      inject the install path into PATH first.
      c3d024e7
    • Seth Hoenig's avatar
      Merge pull request #14181 from hashicorp/cleanup-command-tests-part-2 · f125f9bb
      Seth Hoenig authored
      cleanup: fixing warnings and refactoring of command package, part 2
      f125f9bb
    • Seth Hoenig's avatar
      cleanup: fixing warnings and refactoring of command package, part 2 · 9cc27b3c
      Seth Hoenig authored
      This PR continues the cleanup of the command package, removing linter
      warnings, refactoring to use helpers, making tests easier to read, etc.
      9cc27b3c
    • Seth Hoenig's avatar
      Merge pull request #14172 from hashicorp/cleanup-command-tests-wait-for-node · 6ca539a2
      Seth Hoenig authored
      cleanup: first pass at fixing command package warnings
      6ca539a2
  3. 17 Aug, 2022 8 commits
    • Michael Schurter's avatar
      ccae2bd0
    • Seth Hoenig's avatar
      cleanup: first pass at fixing command package warnings · 6baf6a1f
      Seth Hoenig authored
      This PR is the first of several for cleaning up warnings, and refactoring
      bits of code in the command package. First pass is over acl_ files and
      gets some helpers in place.
      6baf6a1f
    • Phil Renaud's avatar
      8097ee78
    • Phil Renaud's avatar
      Variables-specific keyboard commands (#14165) · fd148aad
      Phil Renaud authored
      * Variables-specific keyboard commands
      
      * Auto-focus the edit button when landing on a variable page, if its available
      fd148aad
    • Phil Renaud's avatar
      [ui] general keyboard navigation: 1.3.4 release (#14138) · 3bf56334
      Phil Renaud authored
      * Initialized keyboard service
      
      Neat but funky: dynamic subnav traversal
      
      👻
      
      generalized traverseSubnav method
      
      Shift as special modifier key
      
      Nice little demo panel
      
      Keyboard shortcuts keycard
      
      Some animation styles on keyboard shortcuts
      
      Handle situations where a link is deeply nested from its parent menu item
      
      Keyboard service cleanup
      
      helper-based initializer and teardown for new contextual commands
      
      Keyboard shortcuts modal component added and demo-ghost removed
      
      Removed j and k from subnav traversal
      
      Register and unregister methods for subnav plus new subnavs for volumes and volume
      
      register main nav method
      
      Generalizing the register nav method
      
      12762 table keynav (#12975)
      
      * Experimental feature: shortcut visual hints
      
      * Long way around to a custom modifier for keyboard shortcuts
      
      * dynamic table and list iterative shortcuts
      
      * Progress with regular old tether
      
      * Delogging
      
      * Table Keynav tether fix, server and client navs, and fix to shiftless on modified arrow keys
      
      Go to Optimize keyboard link and storage key changed to g r
      
      parameterized jobs keyboard nav
      
      Dynamic numeric keynav for multiple tables (#13482)
      
      * Multiple tables init
      
      * URL-bind enumerable keyboard commands and add to more taskRow and allocationRows
      
      * Type safety and lint fixes
      
      * Consolidated push to keyCommands
      
      * Default value when removing keyCommands
      
      * Remove the URL-based removal method and perform a recompute on any add
      
      Get tests passing in Keynav: remove math helpers and a few other defensive moves (#13761)
      
      * Remove ember math helpers
      
      * Test fixes for jobparts/body
      
      * Kill an unneeded integration helper test
      
      * delog
      
      * Trying if disabling percy lets this finish
      
      * Okay so its not percy; try parallelism in circle
      
      * Percyless yet again
      
      * Trying a different angle to not have percy
      
      * Upgrade percy to 1.6.1
      
      [ui] Keyboard nav: "u" key to go up a level (#13754)
      
      * U to go up a level
      
      * Mislabelled my conditional
      
      * Custom lint ignore rule
      
      * Custom lint ignore rule, this time with commas
      
      * Since we're getting rid of ember math helpers elsewhere, do the math ourselves here
      
      Replace ArrowLeft etc. with an ascii arrow (#13776)
      
      * Replace ArrowLeft etc. with an ascii arrow
      
      * non-mutative helper cleanup
      
      Keyboard Nav: let users rebind their shortcuts (#13781)
      
      * click-outside and shortcuts enabled/disabled toggle
      
      * Trap focus when modal open
      
      * Enabled/disabled saved to localStorage
      
      * Autofocus edit button on variable index
      
      * Modal overflow styles
      
      * Functional rebind
      
      * Saving rebinds to localStorage for all majors
      
      * Started on defaultCommandBindings
      
      * Modal header style and cancel rebind on escape
      
      * keyboardable keybindings w buttons instead of spans
      
      * recording and defaultvalues
      
      * Enter short-circuits rebind
      
      * Only some commands are rebindable, and dont show dupes
      
      * No unused get import
      
      * More visually distinct header on modal
      
      * Disallowed keys for rebind, showing buffer as you type, and moving dedupe to modal logic
      
      willDestroy hook to prevent tests from doubling/tripling up addEventListener on kb events
      
      remove unused tests
      
      Keyboard Navigation acceptance tests (#13893)
      
      * Acceptance tests for keyboard modal
      
      * a11y audit fix and localStorage clear
      
      * Bind/rebind/localStorage tests
      
      * Keyboard tests for dynamic nav and tables
      
      * Rebinder and assert expectation
      
      * Second percy snapshot showing hints no longer relevant
      
      Weird issue where linktos with query props specifically from the task-groups page would fail to route / hit undefined.shouldSuperCede errors
      
      Adds the concept of exclusivity to a keycommand, removing peers that also share its label
      
      Lintfix
      
      Changelog and PR feedback
      
      Changelog and PR feedback
      
      Fix to rebinding in firefox by blurring the now-disabled button on rebind (#14053)
      
      * Secure Variables shortcuts removed
      
      * Variable index route autofocus removed
      
      * Updated changelog entry
      
      * Updated changelog entry
      
      * Keynav docs (#14148)
      
      * Section added to the API Docs UI page
      
      * Added a note about disabling
      
      * Prev and Next order
      
      * Remove dev log and unneeded comments
      3bf56334
    • Piotr Kazmierczak's avatar
      cleanup: replace TypeToPtr helper methods with pointer.Of (#14151) · c4be2c60
      Piotr Kazmierczak authored
      Bumping compile time requirement to go 1.18 allows us to simplify our pointer helper methods.
      c4be2c60
    • Jai's avatar
      refact: conditional checks for token secret before fetch (#14134) · b9fec224
      Jai authored
      * refact: conditional checks for token secret before fetch
      
      * refact: guard all authRawReq calls
      
      * refact: safe-guard integration tests
      b9fec224
    • James Rasell's avatar
      8ebd21e9
  4. 16 Aug, 2022 16 commits
  5. 15 Aug, 2022 6 commits
    • Phil Renaud's avatar
      Handle conflict swith a cas qp on save and create (#14100) · 17005261
      Phil Renaud authored
      * Handle conflict swith a cas qp on save and create
      
      * Notify error and give them refresh or overwrite options
      
      * Merge conflict missed, resolved
      
      * Mirage fixture
      
      * Integration test
      
      * Bracket closed (thx jai)
      
      * Adjust tests to account for number of variables with auto-conflicter
      17005261
    • Tim Gross's avatar
      ACL: disallow missing `path` in secure variable policy (#14123) · b9d19522
      Tim Gross authored
      The HCL parser allows for labels that aren't needed, which makes it easy to
      accidentally write a `secure_variable` block that has the intended path as the
      label for that block instead of the innner `path` block. This can result in
      silent failure to lock down variables if an incorrectly specified block was used
      to reduce the scope of capabilities (for example, if another correctly-written
      rule allows access to `*`).
      
      We can't detect the extraneous label in the HCL API, but we can detect if we're
      missing `path` blocks entirely. Use this to block obvious user errors.
      b9d19522
    • Tim Gross's avatar
      api: document warnings for setting `api.ClientConnTimeout` (#14122) · fccc49a5
      Tim Gross authored
      HTTP API consumers that have network line-of-sight to client nodes can connect
      directly for a small number of APIs. But in environments where the consumer
      doesn't have line-of-sight, there's a long pause waiting for the
      `api.ClientConnTimeout` to expire. Warn about this in the API docs so that
      authors can avoid the extra timeout.
      fccc49a5
    • Charlie Voiselle's avatar
      SV CLI: var init (#13820) · 22194d43
      Charlie Voiselle authored
      * Nomad dep: add museli/reflow
      * SV CLI: var init
      22194d43
    • Jai's avatar
      refact: add parent check to boolean (#14115) · 7079692d
      Jai authored
      * refact: add parent check to boolean
      
      * chore:  add changelog entry
      7079692d
    • Phil Renaud's avatar
      UI variables made to be unique by namespace and path (#14072) · 9f51a5de
      Phil Renaud authored
      * Starting on namespaced id
      
      * Traversal for variables uniqued by namespace
      
      * Delog
      
      * Basic CRUD complete w namespaces included
      
      * Correct secvar breadcrumb joining and testfix now that namespaces are included
      
      * Testfixes with namespaces in place
      
      * Namespace-aware duplicate path warning
      
      * Duplicate path warning test additions
      
      * Trimpath reimplemented on dupe check
      
      * Solves a bug where slash was not being passed to the can write check
      
      * PR fixes
      
      * variable paths integration test fix now uses store
      
      * Seems far less hacky in retrospect
      
      * PR feedback addressed
      
      * test fixes after inclusion of path as local non-model var
      
      * Prevent confusion by dropping namespace from QPs on PUT, since its already in .data
      
      * Solves a harsh bug where you have namespace access but no secvars access (#14098)
      
      * Solves a harsh bug where you have namespace access but no secvars access
      
      * Lint cleanup
      
      * Remove unneeded condition
      9f51a5de