Skip to content
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

Add expiration date to vouchers #477

Open
wants to merge 7 commits into
base: development
Choose a base branch
from

Conversation

Eslam-Nawara
Copy link
Collaborator

Description

add expiration date to vouchers

Related Issues

@Eslam-Nawara Eslam-Nawara force-pushed the add-expiration-date-to-vouchers branch from c7d4a22 to 60893dd Compare December 4, 2023 15:28
@@ -73,23 +72,35 @@ func SetUp(t testing.TB) *App {
`, dbPath)

err := os.WriteFile(configPath, []byte(config), 0644)
assert.NoError(t, err)
if !assert.NoError(t, err) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use assert.error

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assert changes the state of the testing object t, fa if I used assert.Error so every time the err = nil (meaning the test had bassed), the t object would report that the test failed

server/app/user_handler.go Outdated Show resolved Hide resolved
server/app/user_handler.go Outdated Show resolved Hide resolved
server/app/voucher_handler.go Outdated Show resolved Hide resolved
server/deployer/deployer.go Show resolved Hide resolved
@@ -154,6 +155,7 @@ func (d *Deployer) loadK8s(k8sDeployInput models.K8sDeployInput, userID string,
ClusterContract: int(k8sContractID),
Master: master,
Workers: workers,
ExpirationDate: time.Now().Add(time.Duration(k8sDeployInput.Duration) * 30 * 24 * time.Hour).Truncate(24 * time.Hour),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why using hours?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's no time.Month duration const to use it directly, max is time.Hour fa I use it to get a month

server/internal/config_parser.go Show resolved Hide resolved
server/models/k8s.go Outdated Show resolved Hide resolved
server/models/quota.go Outdated Show resolved Hide resolved
server/models/quota.go Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants