-
Notifications
You must be signed in to change notification settings - Fork 29
Feat/stackitcli 70 cdn distribution beta cmds 2 #1138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/stackitcli 70 cdn distribution beta cmds 2 #1138
Conversation
| table.AddSeparator() | ||
| table.AddRow("HTTP ORIGIN URL", utils.PtrString(h.OriginUrl)) | ||
| table.AddSeparator() | ||
| table.AddRow("HTTP ORIGIN REQUEST HEADERS", utils.JoinStringMap(*h.OriginRequestHeaders, ": ", ", ")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential nil pointer dereference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if h.OriginRequestHeaders != nil {
table.AddRow("HTTP ORIGIN REQUEST HEADERS", utils.JoinStringMap(*h.OriginRequestHeaders, ": ", ", "))
table.AddSeparator()
}| } else if d.Config.Backend.HttpBackend != nil { | ||
| h := d.Config.Backend.HttpBackend | ||
| var geofencing []string | ||
| for k, v := range *h.Geofencing { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
| } | ||
|
|
||
| // JoinStringMap concatenates the key-value pairs of a string map, key and value separated by kvSep, key value pairs separated by sep. | ||
| func JoinStringMap(m map[string]string, kvSep, sep string) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we please have unit tests for this? Also maybe worth to add this to the SDK core utils pkgs instead the CLI utils pkg.
| return *s | ||
| } | ||
|
|
||
| func Min[T constraints.Ordered](a, b T) T { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we please have unit tests for this? Also maybe worth to add this to the SDK core utils pkgs instead the CLI utils pkg.
| @@ -0,0 +1 @@ | |||
| package describe | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
???
| "k8s.io/utils/ptr" | ||
| ) | ||
|
|
||
| var projectIdFlag = globalflags.ProjectIdFlag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the point of duplicating a constant into a variable? Why not just use the constant directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
me neither, probably copied this from some other place
dbfea3d
into
feat/STACKITCLI-70-add-cdn-distribution-beta-cmds
Description
add distirbutions describe/delete/create/update
relates to STACKITCLI-70
Checklist
make fmtmake generate-docs(will be checked by CI)make test(will be checked by CI)make lint(will be checked by CI)