Repository navigation
feat(cdn): onboard missing functionality - #1774
SerseusWasTaken wants to merge 2 commits into
Conversation
Relates to STACKITCLI-1006
330e8f6 to
245ded1
Compare
| flagRemoveDefaultCacheDuration = "remove-default-cache-duration" | ||
| flagForwardHostHeader = "forward-host-header" | ||
| flagLabels = "labels" | ||
| flagLabelsToRemove = "labels-to-remove" |
There was a problem hiding this comment.
All the other "remove" flags starting with "remove...". This one is the other way around
There was a problem hiding this comment.
I know, i initially had it as removeLabels but i thought it was confusing, since this flag does take an argument, while the other remove[...] flags do not. So i renamed it like this so since this --labelsToRemove key1,key2 looks more intuitive to me than this --removeLabels key1,key2. What do you think?
|
|
||
| labels := flags.FlagToStringToStringPointerPointer(p, cmd, flagLabels) | ||
|
|
||
| removeLabels := flags.FlagToStringSliceValue(p, cmd, flagLabelsToRemove) |
There was a problem hiding this comment.
Out of curiosity: Where is this logic coming from? I was working on another service with labels as well and I haven't seen this logic somewhere else.
There was a problem hiding this comment.
I don't think we have needed such logic in the past. As far as i know, this is the first time we implement the option to remove labels with the update command.
There was a problem hiding this comment.
I also want to note that we can skip the removal of labels, this was not the focus of the PR.
| examples.NewExample( | ||
| `Create a CDN distribution passing the password via stdin`, | ||
| `$ cat secret.txt | stackit beta cdn distribution create -y --project-id xxx \ | ||
| --bucket --bucket-url https://bucket.example.com --bucket-credentials-access-key-id yyyy --bucket-password - --bucket-region EU \ |
There was a problem hiding this comment.
Should we add at least some examples for the new flags here?
There was a problem hiding this comment.
Added an example showing the usage of the two new json flags
| func buildRedirectsTable(redirects *cdn.RedirectConfig) tables.Table { | ||
| table := tables.NewTable() | ||
| table.SetTitle("Redirects") | ||
| table.SetHeader("TARGET URL", "STATUS CODE", "ENABLED", "DESCRIPTION", "MATCHERS") |
There was a problem hiding this comment.
Should we add the match condition as well here?
There was a problem hiding this comment.
Sorry, which match condition do you mean? 😅
…flags to the bottom of the function
Merging this branch will increase overall coverage
Coverage detailsCompared to commit bcd78df (run #47282267585)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files:
|
Description
Adds the following flags:
Create and update
Update only
Checklist
make fmtmake generate-docs(will be checked by CI)make test(will be checked by CI)make lint(will be checked by CI)