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

Inject a RemoteConfig instance #773

Open
Tracked by #591
jeromy-cannon opened this issue Oct 30, 2024 · 0 comments
Open
Tracked by #591

Inject a RemoteConfig instance #773

jeromy-cannon opened this issue Oct 30, 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 30, 2024

Feature: Inject a RemoteConfig instance into a mutable subcommand (invoke constructor)

  Scenario: RemoteConfig is injected successfully using defaults
    Given the user supplies no values for the context, deployment, or namespace
    When the RemoteConfig is injected into a mutating subcommand
    Then context will default to K8:this.kubeConfig.currentContext
    And namespace will default to LocalConfig.currentDeploymentName
    And cluster will be retrieved from LocalConfig based the context to cluster mapping
    And the RemoteConfig read is called and return true [depends on #771]

  Scenario: RemoteConfig is injected successfully
    When the RemoteConfig is injected into a mutating subcommand
    And namespace is provided by the user
    And one cluster is retrieved from the LocalConfig.deployments.clusters[]
    And one context is retrieved from the LocalConfig.clusterMappping[cluster]
    Then the RemoteConfig read is called and return true [depends on #771]

  Scenario: RemoteConfig is injected with namespace and LocalConfig.currentDeploymentName of null
    Given the RemoteConfig is injected into a mutating subcommand
    When the user provided namespace is null
    And the LocalConfig.currentDeploymentName is null
    Then RemoteConfig throws an error explaining that the deployment and namespace cannot be null

  Scenario: RemoteConfig is injected with cluster as null
    Given the RemoteConfig is injected into a mutating subcommand
    And the deployment is retrieved from either the user provided namespace or LocalConfig.currentDeploymentName 
    When the user provided cluster is null
    And the LocalConfig.deployments.clusters[] retrieved for the deployment is empty
    Then RemoteConfig throws an error explaining that a deployment and at least one cluster is needed to continue

  Scenario: RemoteConfig is injected with context as null
    When the RemoteConfig is injected into a mutating subcommand
    And the deployment is retrieved from either the user provided namespace or LocalConfig.currentDeploymentName 
    And the cluster is retrieved from the user or the LocalConfig.deployments.clusters[]
    And the context is null when retrieved from the cluster mapping
    Then RemoteConfig throws an error explaining that a context must be mapped to the deployment/cluster combination, displaying them to the user in the error message

  Scenario: RemoteConfig is injected and fails the read
    When the RemoteConfig is injected into a mutating subcommand
    And the deployment is retrieved from either the user provided namespace or LocalConfig.currentDeploymentName 
    And the cluster is retrieved from the user or the LocalConfig.deployments.clusters[]
    And the context is retrieved from the cluster mapping
    And the RemoteConfig read from k8s for the namespace/cluster/context fails
    Then RemoteConfig throws an error explaining if no file was found or if the file was found but failed to download successfully

  Scenario: RemoteConfig is injected, reads successfully, and validates as true
    When the RemoteConfig is injected into a mutating subcommand
    And the deployment is retrieved from either the user provided namespace or LocalConfig.currentDeploymentName 
    And the cluster is retrieved from the user or the LocalConfig.deployments.clusters[]
    And the context is retrieved from the cluster mapping
    And the RemoteConfig read from k8s for the namespace/cluster/context succeeds
    And the validate method is called and returns true (stubbed to return true for now)
    Then RemoteConfig was injected successfully

  Scenario: RemoteConfig is injected, reads successfully, and validates as false
    When the RemoteConfig is injected into a mutating subcommand
    And the deployment is retrieved from either the user provided namespace or LocalConfig.currentDeploymentName 
    And the cluster is retrieved from the user or the LocalConfig.deployments.clusters[]
    And the context is retrieved from the cluster mapping
    And the RemoteConfig read from k8s for the namespace/cluster/context succeeds
    And the validate method is called and returns false (mocked to return false)
    Then RemoteConfig failed to inject successfully
@jeromy-cannon jeromy-cannon added P0 An issue impacting production environments or impacting multiple releases or multiple individuals. Needs Refinement The issue needs more refinement and/or design before it can be worked labels Oct 30, 2024
@jeromy-cannon jeromy-cannon self-assigned this Oct 30, 2024
@jeromy-cannon jeromy-cannon removed their assignment 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 1, 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

When branches are created from issues, their pull requests are automatically linked.

2 participants