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

[full-ci][tests-only]Add support to update running service in ociswrapper #11003

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

amrita-shrestha
Copy link
Contributor

Description

This PR add support to update running service with extra env.

Tests cases

  1. run ocis and start ocis service
  2. run ocis and upate ocis env with PUT method then start ocis service
    • ocis instance should be running with env set by PUT request

Related Issue

Motivation and Context

How Has This Been Tested?

  • locally

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@amrita-shrestha amrita-shrestha force-pushed the add-support-to-update-restart-ocis-service branch from aaa382d to 8600467 Compare February 17, 2025 09:07
Comment on lines +326 to +328
message := fmt.Sprintf("Service %s stopped successfully", service)
log.Println(message)
return true, fmt.Sprintf(message)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
message := fmt.Sprintf("Service %s stopped successfully", service)
log.Println(message)
return true, fmt.Sprintf(message)
return true, fmt.Sprintf("Service %s stopped successfully", service)

@@ -364,7 +361,7 @@ func WaitForServiceStatus(service string, waitForUp bool) bool {
log.Println(fmt.Sprintf("%s service is not ready on port %d. %v", service, port, err))
} else {
if err != nil {
log.Println(fmt.Sprintf("%s service port %d is no longer reachable", service, port))
log.Println(fmt.Sprintf("%s service port %d is no longer reachable", service, port))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
log.Println(fmt.Sprintf("%s service port %d is no longer reachable", service, port))
log.Println(fmt.Sprintf("%s service port %d is no longer reachable", service, port))

for key, value := range envBody {
serviceEnvMap = append(serviceEnvMap, fmt.Sprintf("%s=%v", key, value))
ocis.ServiceEnvConfigs = append(serviceEnvMap, fmt.Sprintf("%s=%v", key, value))
Copy link
Member

Choose a reason for hiding this comment

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

we need to store envs separately for different services. So maybe:

ServiceEnvConfigs = ["serviceA" => [...envs], "serviceB" => [...envs]]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants