Skip to content
This repository was archived by the owner on Dec 16, 2025. It is now read-only.
This repository was archived by the owner on Dec 16, 2025. It is now read-only.

Some env variables are not needed when local_mode is enabled #100

Closed

Description

@michal-gubricky

/kind feature

Describe the solution you'd like
Based on the introduction of local_mode feature(see issue #76). Some env variables are not needed when we are using local_mode. Adjust .envrc.sample and also remove these unnecessary env variables in make target env-vars-for-wl-cluster.

Activity

  1. kranurag7 commented on Feb 20, 2024

    @kranurag7
    Contributor

    @michal-gubricky We don't use these CAPI features in this repo.

    --- a/.envrc.sample
    +++ b/.envrc.sample
    @@ -3,11 +3,7 @@ export GIT_PROVIDER_B64=Z2l0aHVi
     export GIT_ACCESS_TOKEN_B64=mybase64encodedtoken
     export GIT_ORG_NAME_B64=U292ZXJlaWduQ2xvdWRTdGFjaw==
     export GIT_REPOSITORY_NAME_B64=Y2x1c3Rlci1zdGFja3M=
    -export EXP_CLUSTER_RESOURCE_SET=true
    -export EXP_MACHINE_POOL=true
     export CLUSTER_TOPOLOGY=true
    -export EXP_RUNTIME_SDK=true
    -export EXP_MACHINE_SET_PREFLIGHT_CHECKS=true
     export CLUSTER_NAME=test-dfkhje
     export SECRET_NAME=supersecret
     export CLOUD_NAME=test
  2. michal-gubricky commented on Feb 21, 2024

    @michal-gubricky
    ContributorAuthor

    I tested local_mode without unnecessary env variables(like GIT_PROVIDER_B64, etc..), and after I specified clusterstack version, which was not available in .release directory. I found these logs:
    from CSO:

    {"level":"INFO","time":"2024-02-21T13:20:47.810Z","file":"fake/github_client.go:67","message":"WARNING: called DownloadReleaseAssets of fake Github client","controller":"clusterstackrelease","controllerGroup":"clusterstack.x-k8s.io","controllerKind":"ClusterStackRelease","ClusterStackRelease":{"name":"openstack-scs-1-27-v1","namespace":"cluster"},"namespace":"cluster","name":"openstack-scs-1-27-v1","reconcileID":"3f2bd577-21c4-4272-80be-3a61db50df8f"}
    

    from CSPO:

    2024-02-21T13:20:42Z    DEBUG   events  failed to create git config: environment variable GIT_PROVIDER is not set       {"type": "Warning", "object": {"kind":"OpenStackClusterStackRelease","namespace":"cluster","name":"openstack-scs-1-27-v1","uid":"b6f42c4c-395c-41d9-bc35-7f4af3bad1b3","apiVersion":"infrastructure.clusterstack.x-k8s.io/v1alpha1","resourceVersion":"3487"}, "reason": "GitTokenOrEnvVariableNotSet"}
    

    And I think it is a little bit strange because even if you provide env variable GIT_PROVIDER(which you don't expect to have to specify when you are using local_mode) it shouldn't work because CSO doesn't pull the clusterstack from GitHub anyway. I think we should also implement a fake GitHub client like in CSO. What do you think of this @kranurag7 ?

  3. matofeder commented on Feb 23, 2024

    @matofeder
    Member

    @michal-gubricky

    It seems that this edge case is covered differently in CSO than in CSPO.
    In CSO there is an option to enable local_mode and then it is also handled in the code, which result in different behavior like in CSPO.

    IMO CSPO could implement this in the same way as CSO. I would like to propose creating a separate issue for the implementation. IMO this should have a lover priority.

  4. janiskemper commented on Feb 23, 2024

    @janiskemper
    Member

    it will try to download if the release assets are not available locally @matofeder @michal-gubricky ... You can implement the fake client but it gives you another error message (as you see in your message above), it doesn't change anything in the implementation

  5. matofeder commented on Feb 23, 2024

    @matofeder
    Member

    it will try to download if the release assets are not available locally @matofeder @michal-gubricky ... You can implement the fake client but it gives you another error message (as you see in your message above), it doesn't change anything in the implementation

    Agree, but the different behavior could be strange in some cases, hence I would like to propose not allowing the download from GitHub in the case of local_mode and the fake client could be one option, but IMO better to inform the user that CSPO does not find the cluster-stack locally in the local_mode=true

  6. janiskemper commented on Feb 23, 2024

    @janiskemper
    Member

    this would be possible... We would just have to rename the log message

  7. added
    Container
    on Feb 28, 2024
  8. added
    Sprint Wellington
    on Feb 28, 2024
  9. moved this from Backlog to Done in Sovereign Cloud Stackon Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

ContainerSprint Wellington

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions