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

Implement solo context connect - connects to a deployment and pulls back the RemoteConfig #755

Open
Tracked by #588
jeromy-cannon opened this issue Oct 28, 2024 · 0 comments
Assignees
Labels
HashSphere Requirement P0 An issue impacting production environments or impacting multiple releases or multiple individuals.

Comments

@jeromy-cannon
Copy link
Contributor

jeromy-cannon commented Oct 28, 2024

  • solo context connect --namespace solo-1
    • will attempt to connect to the cluster with the current kubectl context and look for a remote config
    • --namespace solo-1 - the namespace where the remote config is stored
  • solo context connect --namespace solo-1 --cluster kind-solo --context kind-solo
    • will attempt to connect to the provided cluster with the provided context and look for a remote config
    • --namespace solo-1 - the namespace where the remote config is stored
Feature: 

  Scenario: connects to a single cluster deployment with only the namespace given and pulls back a valid RemoteConfig
    Given Solo is called with `solo context connect --namespace solo-1`
    When the cluster is pulled from the LocalConfig
    And the context is pulled from the LocalConfig
    And a connection is made to the cluster
    And a RemoteConfig is found
    And the RemoteConfig is valid
    Then the LocalConfig will be updated with the deployment and cluster/context mappings as needed

  Scenario: connects to a single cluster deployment with only the namespace given and pulls back an invalid RemoteConfig
    Given Solo is called with `solo context connect --namespace solo-1`
    When the cluster is pulled from the LocalConfig
    And the context is pulled from the LocalConfig
    And a connection is made to the cluster
    And a RemoteConfig is found
    And the RemoteConfig is not valid
    Then a SoloError will be thrown informing the user that the RemoteConfig was not valid
    And provide them with the context, cluster, and namespace
    And inform them that the RemoteConfig will need to be manually fixed

  Scenario: connects to a single cluster deployment with provided namespace, cluster, and context given and pulls back a valid RemoteConfig
    Given Solo is called with `solo context connect --namespace solo-1 --context kind-solo-1 --cluster kind-solo-1`
    When a connection is made to the cluster
    And a RemoteConfig is found
    And the RemoteConfig is valid
    Then the LocalConfig will be updated with the deployment and cluster/context mappings as needed

  Scenario: connects to a single cluster deployment with provided namespace, cluster, and context given and pulls back an invalid RemoteConfig
    Given Solo is called with `solo context connect --namespace solo-1 --context kind-solo-1 --cluster kind-solo-1`
    When a connection is made to the cluster
    And a RemoteConfig is found
    And the RemoteConfig is not valid
    Then a SoloError will be thrown informing the user that the RemoteConfig was not valid
    And provide them with the context, cluster, and namespace
    And inform them that the RemoteConfig will need to be manually fixed

  Scenario: connects to a two cluster deployment then uses the valid RemoteConfig to pull back the RemoteConfig from the second cluster both are valid and match
    Given Solo is called with `solo context connect --namespace solo-1 --context kind-solo-1 --cluster kind-solo-1`
    When a connection is made to the cluster
    And a RemoteConfig is found
    And the RemoteConfig is valid
    And the RemoteConfig has a second cluster listed in the deployment
    And the LocalConfig has a context mapping for the cluster
    And a connection is made to the 2nd cluster
    And the RemoteConfig is found
    And the RemoteConfig is valid
    And both the RemoteConfigs match
    Then the LocalConfig will be updated with the deployment and cluster/context mappings as needed

  Scenario: connects to a two cluster deployment then uses the valid RemoteConfig to pull back the RemoteConfig from the second cluster and the user will be prompted for the context for the second cluster
    Given Solo is called with `solo context connect --namespace solo-1 --context kind-solo-1 --cluster kind-solo-1`
    When a connection is made to the cluster
    And a RemoteConfig is found
    And the RemoteConfig is valid
    And the RemoteConfig has a second cluster listed in the deployment
    And the LocalConfig does not have a context mapping for the cluster
    Then the user will be prompted for a context to use for the cluster
    And a connection is made to the 2nd cluster ... (see prior scenario)

  Scenario: connects to a two cluster deployment then uses the valid RemoteConfig to pull back the RemoteConfig from the second cluster and the user will be prompted for the context for the but fails
    Given Solo is called with `solo context connect --namespace solo-1 --context kind-solo-1 --cluster kind-solo-1`
    When a connection is made to the cluster
    And a RemoteConfig is found
    And the RemoteConfig is valid
    And the RemoteConfig has a second cluster listed in the deployment
    And the LocalConfig does not have a context mapping for the cluster
    Then the user will be prompted for a context to use for the cluster
    And either the user provided context fails the connection or the user fails to provide a context
    And a SoloError is thrown informing the user to continue to connect to this deployment they will need to setup the Kubernetes context that points to the cluster/namespace and provided them with the cluster and namespace

  Scenario: connects to a two cluster deployment then uses the valid RemoteConfig to pull back the RemoteConfig from the second cluster both are valid but do not match
    Given Solo is called with `solo context connect --namespace solo-1 --context kind-solo-1 --cluster kind-solo-1`
    When a connection is made to the cluster
    And a RemoteConfig is found
    And the RemoteConfig is valid
    And the RemoteConfig has a second cluster listed in the deployment
    And the LocalConfig has a context mapping for the cluster
    And a connection is made to the 2nd cluster
    And the RemoteConfig is found
    And the RemoteConfig is valid
    And both the RemoteConfigs do not match
    Then a SoloError is thrown informing the user of the deployment details with the namespace and cluster/context mappings and telling them that the RemoteConfigs do not match and will have to be manually fixed to synchronize them

  Scenario: connects to a two cluster deployment then uses the valid RemoteConfig to pull back the RemoteConfig from the second cluster where the second is not valid
    Given Solo is called with `solo context connect --namespace solo-1 --context kind-solo-1 --cluster kind-solo-1`
    When a connection is made to the cluster
    And a RemoteConfig is found
    And the RemoteConfig is valid
    And the RemoteConfig has a second cluster listed in the deployment
    And the LocalConfig has a context mapping for the cluster
    And a connection is made to the 2nd cluster
    And the RemoteConfig is found
    And the RemoteConfig is not valid
    Then a SoloError will be thrown informing the user that the RemoteConfig was not valid
    And provide them with the context, cluster, and namespace
    And inform them that the RemoteConfig will need to be manually fixed
@jeromy-cannon jeromy-cannon added P0 An issue impacting production environments or impacting multiple releases or multiple individuals. HashSphere Requirement Needs Refinement The issue needs more refinement and/or design before it can be worked labels Oct 28, 2024
@jeromy-cannon jeromy-cannon self-assigned this Nov 1, 2024
@jeromy-cannon jeromy-cannon removed the Needs Refinement The issue needs more refinement and/or design before it can be worked label Nov 8, 2024
@jeromy-cannon jeromy-cannon removed their assignment Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HashSphere Requirement P0 An issue impacting production environments or impacting multiple releases or multiple individuals.
Projects
None yet
Development

No branches or pull requests

2 participants