Skip to content

Commit

Permalink
License support - review feedback update
Browse files Browse the repository at this point in the history
  • Loading branch information
devdattakulkarni committed Aug 3, 2024
1 parent 18f016a commit a5e62f8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 deletions.
20 changes: 10 additions & 10 deletions deploy/kubeconfiggenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1209,17 +1209,17 @@ def check_license():

msg = ""

cmd1 = "kubectl get " + kind
out1, err1 = run_command(cmd1)
created_instances = 0
for line in out1.split("\n"):
line = line.strip()
app.logger.info("Line:" + line + "\n")
if "NAME" not in line and "AGE" not in line and line != "":
created_instances = created_instances + 1
app.logger.info("Already created instances:" + str(created_instances))

if allowed_instances != "":
cmd1 = "kubectl get " + kind
out1, err1 = run_command(cmd1)
created_instances = 0
for line in out1.split("\n"):
line = line.strip()
app.logger.info("Line:" + line + "\n")
if "NAME" not in line and "AGE" not in line and line != "":
created_instances = created_instances + 1
app.logger.info("Already created instances:" + str(created_instances))

if created_instances >= int(allowed_instances):
msg = msg + "Allowed number of instances reached."

Expand Down
2 changes: 1 addition & 1 deletion plugins/crlicense.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def create_license(self, kind, license_file, expiry, num_of_instances, kubeconfi
appinstances = ''
if args.appinstances:
appinstances = args.appinstances
if int(appinstances) < 0:
if int(appinstances) <= 0:
print("App instances should be > 0.")
exit(0)

Expand Down
2 changes: 0 additions & 2 deletions plugins/kubectl-license-delete
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/bash

#python3 crlicense.py delete "$@"

source utils.sh

print_help () {
Expand Down
2 changes: 0 additions & 2 deletions plugins/kubectl-license-get
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/bash

#python3 crlicense.py get "$@"

source utils.sh

print_help () {
Expand Down

0 comments on commit a5e62f8

Please sign in to comment.