Skip to content

Commit

Permalink
fix: add a timestamp to the telegraf label creation to insure uniqueness
Browse files Browse the repository at this point in the history
  • Loading branch information
hoorayimhelping committed Dec 11, 2019
1 parent 8729cd0 commit b8f58d4
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
1. [16172](https://github.com/influxdata/influxdb/pull/16172): Fixed table ui threshold colorization issue where setting thresholds would not change table UI
1. [16194](https://github.com/influxdata/influxdb/pull/16194): Fixed windowPeriod issue that stemmed from webpack rules
1. [16175](https://github.com/influxdata/influxdb/pull/16175): Added delete functionality to note cells so that they can be deleted
1. [16204](https://github.com/influxdata/influxdb/pull/16204): Fix failure to create labels when creating telegraf configs

### UI Improvements

Expand Down
24 changes: 24 additions & 0 deletions ui/cypress/e2e/collectors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,30 @@ describe('Collectors', () => {
})
})
})

// fix for https://github.com/influxdata/influxdb/issues/15730
it('creates a cofiguration with a unique label', () => {
cy.contains('Create Configuration').click()

cy.contains('Docker').click()

cy.contains('Continue').click()

cy.contains('docker').click()

cy.get('[name="endpoint"]').type('http://localhost')

cy.contains('Done').click()
cy.get('input[title="Telegraf Configuration Name"]').type('Label 1')
cy.get('input[title="Telegraf Configuration Description"]').type(
'Description 1'
)

cy.contains('Create and Verify').click()

cy.contains('Your configurations have been saved')
})

describe('Label creation and searching', () => {
beforeEach(() => {
const description = 'Config Description'
Expand Down
3 changes: 2 additions & 1 deletion ui/src/dataLoaders/actions/dataLoaders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -454,10 +454,11 @@ const createTelegraf = async (dispatch, getState, plugins) => {

const createdLabel = await client.labels.create({
orgID: org.id,
name: '@influxdata.token',
name: `@influxdata.token-${new Date().getTime()}`,
properties,
})

console.log('label', createdLabel)
// add label to telegraf config
const label = await client.telegrafConfigs.addLabel(tc.id, createdLabel)

Expand Down
2 changes: 1 addition & 1 deletion ui/src/shared/constants/fluxFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1448,7 +1448,7 @@ export const FLUX_FUNCTIONS: FluxToolbarFunction[] = [
name: 'timeout',
desc: 'Timeout for the GET request. Default is `30s`.',
type: 'Duration',
}
},
],
package: 'experimental/http',
desc:
Expand Down

0 comments on commit b8f58d4

Please sign in to comment.