Commit Graph

21611 Commits

Author SHA1 Message Date
Mahmood Ali
44ea61ef3a cli: Use glint to determine if os.Stdout is tty (#10926)
Use glint to determine if os.Stdout is a terminal.

glint Terminal renderer expects os.Stdout [not only to be a terminal, but also to have non-zero size](b492b545f6/renderer_term.go (L39-L46)). It's unclear how this condition arises, but this additional check causes Nomad to render deployments progress through glint when glint cannot support it.

By using golint to perform the check, we eliminate the risk of mis-judgement.
2021-07-23 11:27:47 -04:00
Seth Hoenig
36d2f9f992 Merge pull request #10924 from hashicorp/deps-upgrade-consul-api
deps: upgrade consul api to 1.9.1
2021-07-22 12:41:56 -05:00
Seth Hoenig
282450fe78 Merge pull request #10925 from hashicorp/deps-update-aws-cpus
env/aws: update ec2 cpu data
2021-07-22 12:41:25 -05:00
Jai
2020737b4b Merge pull request #10893 from hashicorp/f-ui/namespace-acl-bug
edit ember-can to add additional attribute for namespace
2021-07-22 12:57:34 -04:00
Jai Bhagat
65fd437a4a ui: fixes #10885 2021-07-22 11:44:25 -04:00
Jai Bhagat
18ddb2d344 edit namespace property in handlebar file to use computed property in component 2021-07-22 11:43:45 -04:00
Seth Hoenig
ec4fa410a7 env/aws: update ec2 cpu data
using tools/ec2info

```
$ go run .
```
2021-07-22 09:32:46 -05:00
Seth Hoenig
950aa05790 deps: upgrade consul api to 1.9.1 2021-07-22 09:26:20 -05:00
Seth Hoenig
992383a9e5 Merge pull request #10904 from hashicorp/b-no-affinity-intern
core: remove internalization of affinity strings
2021-07-22 09:09:07 -05:00
Jai Bhagat
3e07db87d4 address merge conflicts 2021-07-21 17:30:11 -04:00
James Rasell
1efebbe367 Merge pull request #10921 from hashicorp/b-fix-regions-api-docs
docs: fixup regions API documentation path to include version.
2021-07-21 18:29:09 +02:00
Luiz Aoqui
d6217597d2 fix nomad alloc signal help message (#10917) 2021-07-21 11:02:44 -04:00
Luiz Aoqui
10d750161f changelog: add entry for #10675 (#10919) 2021-07-21 10:05:48 -04:00
Luiz Aoqui
af0ee7bd7a docs: fix ACL enabled parameter description (#10918) 2021-07-21 10:05:18 -04:00
James Rasell
c3c50e33da docs: fixup regions API documentation path to include version. 2021-07-21 12:14:19 +02:00
Nicholas Cioli
801a7324a3 ui: add parameterized dispatch interface (#10675)
* ui: add parameterized dispatch interface

This commit adds a new interface for dispatching parameteried jobs, if
the user has the right permissions. The UI can be accessed by viewing a
parameterized job and clicking on the "Dispatch Job" button located in
the "Job Launches" section.

* fix failing lint test

* clean up dispatch and remove meta

This commit cleans up a few things that had typos and
inconsistent naming. In line with this, the custom
`meta` view was removed in favor of using the
included `AttributesTable`.

* ui: encode dispatch job payload and start adding tests

* ui: remove unused test imports

* ui: redesign job dispatch form

* ui: initial acceptance tests for dispatch job

* ui: generate parameterized job children with correct id format

* ui: fix job dispatch breadcrumb link

* ui: refactor job dispatch component into glimmer component and add form validation

* ui: remove unused CSS class

* ui: align job dispatch button

* ui: handle namespace-specific requests on job dispatch

* ui: rename payloadMissing to payloadHasError

* ui: don't re-fetch job spec on dispatch job

* ui: keep overview tab selected on job dispatch page

* ui: fix task and task-group linting

* ui: URL encode job id on dispatch job tests

* ui: fix error when job meta is null

* ui: handle job dispatch from adapter

* ui: add more tests for dispatch job page

* ui: add "job dispatch" capability check

* ui: update job dispatch from code review

Co-authored-by: Luiz Aoqui <luiz@hashicorp.com>
2021-07-20 18:27:41 -04:00
Jai Bhagat
b09559eb9e refactoring for same regression in job versions
In job versions, if you have an ACL token with a write policy
you should be able to revert a job, however, that was not the
case here. This is because we're using ember-can to check if
the user can run a job. That permission relies on policiesSupportRunning
which uses a function called namespaceIncludesCapability. We're going to
need to refactor any cases that use this function.
2021-07-20 16:24:42 -04:00
Mahmood Ali
3165ae8112 client: avoid acting on stale data after launch (#10907)
When the client launches, use a consistent read to fetch its own allocs,
but allow stale read afterwards as long as reads don't revert into older
state.

This change addresses an edge case affecting restarting client. When a
client restarts, it may fetch a stale data concerning its allocs: allocs
that have completed prior to the client shutdown may still have "run/running"
desired/client status, and have the client attempt to re-run again.

An alternative approach is to track the indices such that the client
set MinQueryIndex on the maximum index the client ever saw, or compare
received allocs against locally restored client state. Garbage
collection complicates this approach (local knowledge is not complete),
and the approach still risks starting "dead" allocations (e.g. the
allocation may have been placed when client just restarted and have
already been reschuled by the time the client started. This approach
here is effective against all kinds of stalness problems with small
overhead.
2021-07-20 15:13:28 -04:00
Michael Schurter
179e88c52b Merge pull request #10849 from benbuzbee/benbuz/fix-destroy
Don't treat a failed recover + successful destroy as a successful recover
2021-07-19 10:49:31 -07:00
Michael Schurter
f2fddc9a75 docs: add changelog entry for #10849 2021-07-16 15:58:58 -07:00
Kent 'picat' Gruber
dfe003dfc2 Merge pull request #10886 from hashicorp/cli-handle-successful-deployment
Handle successful/canceled/blocked deployments in CLI output
2021-07-16 12:27:22 -04:00
Mahmood Ali
202d189d35 Merge pull request #10905 from tgxworld/patch-1
Fix typo.
2021-07-16 11:00:31 -04:00
Kent 'picat' Gruber
fc3ff8ee13 Update deployment status doc example output 2021-07-16 09:58:58 -04:00
Alan Guo Xiang Tan
a6d8995f9b Fix typo. 2021-07-16 13:49:15 +08:00
Kent 'picat' Gruber
4bcc72da1a Handle DeploymentStatusFailed unless hasAutoRevert 2021-07-15 17:06:13 -04:00
Seth Hoenig
aa8639231d core: remove internalization of affinity strings
Basically the same as #10896 but with the Affinity struct.
Since we use reflect.DeepEquals for job comparison, there is
risk of false positives for changes due to a job struct with
memoized vs non-memoized strings.

Closes #10897
2021-07-15 15:15:39 -05:00
Mahmood Ali
428174ab55 Merge pull request #10875 from hashicorp/b-namespace-flag-override
cli: `-namespace` should override job namespace
2021-07-14 17:28:36 -04:00
Mahmood Ali
6c6a364bbf Merge pull request #10864 from hashicorp/b-10746-plan-datacenter
scheduler: datacenter updates should be destructive
2021-07-14 17:25:13 -04:00
Mahmood Ali
86bbb9abe5 ci: prepare unprivileged user for checkout (#10900)
Job `test-e2e` uses an unprivileged user to compile and run tests.
Ensure that the user has ssh and git properly configured to checkout
dependencies.
2021-07-14 16:12:04 -04:00
Seth Hoenig
7c962b54ad Merge pull request #10898 from hashicorp/f-rm-vendor
build: no longer use vendor directory
2021-07-14 13:00:41 -05:00
Seth Hoenig
8d0e31989d Merge pull request #10896 from hashicorp/b-rm-constraint-memoization
core: do not internalize constraint strings
2021-07-14 11:22:49 -05:00
Seth Hoenig
ec6eaac4c7 docs: update changelog 2021-07-14 11:21:00 -05:00
Seth Hoenig
8869c4ddd1 build: no longer use vendor directory
This PR removes the vendor directory from the Nomad repository.
Contributers will no longer need to deal with our `make sync`
step when working on Nomad, which was suprising when making changes
to the api. It also causes huge diffs in PRs that nobody looks at.
2021-07-14 11:13:30 -05:00
Seth Hoenig
2f2eef00a1 docs: add changelog entry 2021-07-14 10:46:40 -05:00
Seth Hoenig
564be22f79 core: add spec changed test with constriants 2021-07-14 10:44:09 -05:00
Seth Hoenig
755c5fa388 core: fix constraint tests 2021-07-14 10:39:38 -05:00
Seth Hoenig
07c57ffeab core: do not memoize constraint strings
This PR causes Nomad to no longer memoize the String value of
a Constraint. The private memoized variable may or may not be
initialized at any given time, which means a reflect.DeepEqual
comparison between two jobs (e.g. during Plan) may return incorrect
results.

Fixes #10836
2021-07-14 10:04:35 -05:00
James Rasell
7538eed733 Merge pull request #10892 from hashicorp/b-gh-10890
deps: update consul-template to v0.25.2.
2021-07-14 09:26:16 +02:00
Luiz Aoqui
34e0291eb7 changelog: add entry for GH-10563 (#10894) 2021-07-13 16:12:41 -04:00
Jai Bhagat
d92261e2b0 edit ember-can to add additional attribute for namespace
We wanted the ability to get our namespace from query params
in order to do this, we're using additional attributes via
ember-can to set a bound property directly from our
handlebar file. This sets us up better in the event that
the namespace filter changes on the UI because our handlebar
file will be aware of the change, whereas our ability may not
update as the namespace filter updates.
2021-07-13 15:14:38 -04:00
James Rasell
2a54036891 changelog: add entry for #10892 2021-07-13 10:29:44 +02:00
James Rasell
0e197d540e deps: update consul-template to v0.25.2. 2021-07-13 09:46:32 +02:00
Georges-Etienne Legendre
86fca8f513 Capture ACL Token from self API call for Reverse Proxy use-case (#10563)
* Proposed fix for #10561

Signed-off-by: Georges-Etienne Legendre <legege@legege.com>

* Add acceptance tests for reverse proxy use-case

Signed-off-by: Georges-Etienne Legendre <legege@legege.com>

* Use reads instead of computed/get

Signed-off-by: Georges-Etienne Legendre <legege@legege.com>

* Move back the line closer to the task

Signed-off-by: Georges-Etienne Legendre <legege@legege.com>

* skip a11y-audit-called lint rule on reverse proxy tests

Co-authored-by: Luiz Aoqui <luiz@hashicorp.com>
2021-07-12 20:42:08 -04:00
Noel Quiles
e7dbd5af0e Bump hashi-stack-menu (#10889) 2021-07-12 15:44:42 -04:00
Seth Hoenig
f453e483d8 Merge pull request #10883 from hashicorp/b-multi-ingress
consul/connect: fix bug causing high cpu with multiple connect sidecars in group
2021-07-12 10:13:41 -05:00
Seth Hoenig
a18d901bb0 consul/connect: add missing import statements 2021-07-12 09:28:16 -05:00
Seth Hoenig
3ac8d4e7a6 consul/connect: use join host port
Co-authored-by: Michael Schurter <mschurter@hashicorp.com>
2021-07-12 09:04:54 -05:00
Jai
0ef51f1383 Merge pull request #10755 from hashicorp/f-ui/nomad-agent-version
Closes Nomad UI showing 'vUnknown' #10672
2021-07-11 16:58:11 -04:00
Jai Bhagat
bcb3e64237 add name property back to agent schema in ember mirage
The name property had to be added back to the agent schema
in the Agent Factory because the /agent/monitor endpoint in
the config finds agents by their names and since member is not
a proper entity in our Mirage Config we can't just findBy name
of the member. So although we're following the correct schema
we're set-up to rely on this.
2021-07-11 16:09:43 -04:00
Kent 'picat' Gruber
440d556fdb Handle successful/canceled/blocked deployments in CLI output
Otherwise the spinner would just end, which felt a bit awkward.

I wanted to see a  "✓" to know that everything was ok, and a "!" (maybe something else?) if something went wrong.
2021-07-09 19:27:55 -04:00