KusionStack / konfig

Shared repository of application models and components, and CI suite for GitOps workflows
Apache License 2.0
27 stars 32 forks source link

missing resources in the compiled data when defining a multiple components Server #81

Closed amyXia1994 closed 1 year ago

amyXia1994 commented 1 year ago

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

  1. add another component in the appops/guestbook-frontend/base/base.k with following code:
    redisLeader: frontend.Server {
    # Main Container Configuration
    mainContainer = container.Main {
        name = "leader"
        ports = [{containerPort = 6379}]
    }
    image = "docker.io/redis:6.0.5"
    selector = {
        "app"  = "redis"
    }
    labels = {
        "app"  = "redis"
        "role" = "leader"
        "tier" = "backend"
    }
    podMetadata.labels: {
        "role" = "leader"
        "tier" = "backend"
        "app"  = "redis"
    }
    schedulingStrategy.resource = res_tpl.tiny
    services = [
        service.Service {
            name = "redis-leader"
            ports = [
                {
                    "port" = 6379
                }
            ]
        }
    ]
    }
  2. kusion compile -w appops/guestbook-frontend/dev
  3. cat appops/guestbook-frontend/dev/ci-test/stdout.golden.yaml

2. What did you expect to see? (Required)

the compiled data contains 2 deployments, 2 service, 1 namespace

3. What did you see instead (Required)

1 deployment, 1 service, 1 namespace

4. What is your KusionStack components version? (Required)

I think it has nothing to do with my kusion version. anyway:

releaseVersion: v0.7.2
gitInfo:
    latestTag: v0.7.2
    commit: fb996130c1e4a8a30da7c04e672433ea6c870384
    treeState: clean
buildInfo:
    goVersion: go1.17.13
    GOOS: linux
    GOARCH: amd64
    numCPU: 2
    compiler: gc
    buildTime: "2022-12-02 07:00:28"
dependency:
    kclvmgoVersion: v0.4.4-alpha.1
    kclPluginVersion: v0.4.1-alpha2