Skip to content

Commit

Permalink
feat: command id generator support
Browse files Browse the repository at this point in the history
Signed-off-by: chenk <[email protected]>
  • Loading branch information
chen-keinan committed Jun 4, 2024
1 parent 92ce4c5 commit af9c486
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ bundle: create-bundle verify-bundle
id:
@go run ./cmd/id

.PHONY: command-id
command-id:
@go run ./cmd/command_id

.PHONY: outdated-api-updated
outdated-api-updated:
sed -i.bak "s|recommendedVersions :=.*|recommendedVersions := $(OUTDATE_API_DATA)|" $(DYNAMIC_REGO_FOLDER)/outdated_api.rego && rm $(DYNAMIC_REGO_FOLDER)/outdated_api.rego.bak
Expand Down
4 changes: 3 additions & 1 deletion cmd/command__id/main.go → cmd/command_id/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ func main() {
if err != nil {
panic(err)
}
fmt.Println("The following Command ID id free.")
for i := 0; i < len(ids); i++ {
if !ids[i] {
println(fmt.Sprintf("%s-%04d", "CMD", i+1))
println(fmt.Sprintf("%s %s-%04d", "K8s Command:", "CMD", i+1))
return
}
}
}
Expand Down

0 comments on commit af9c486

Please sign in to comment.