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

Add podSpec to generated environment manifest #3033

Merged
merged 11 commits into from
Oct 9, 2024
Merged

Conversation

soharab-ic
Copy link
Contributor

@soharab-ic soharab-ic commented Oct 8, 2024

Description

  • Add podSpec to generated environment manifest file. This will help user utilize the podSpec fields for thier enviroment.
  • With this change, user can easily set nodeSelector, add sidecar containers etc. to environment pods.

New environment manifest:

$ fission env create --name go --image ghcr.io/fission/go-env --builder ghcr.io/fission/go-builder --dry
apiVersion: fission.io/v1
kind: Environment
metadata:
  creationTimestamp: null
  name: go
spec:
  builder:
    command: build
    container:
      name: builder
      resources: {}
    image: ghcr.io/fission/go-builder
    podspec:
      containers:
      - name: builder
        resources: {}
  imagepullsecret: ""
  keeparchive: false
  poolsize: 3
  resources: {}
  runtime:
    container:
      name: go
      resources: {}
    image: ghcr.io/fission/go-env
    podspec:
      containers:
      - name: go
        resources: {}
  version: 3

Old environment manifest:

$ fission env create --name go --image ghcr.io/fission/go-env --builder ghcr.io/fission/go-builder --dry
apiVersion: fission.io/v1
kind: Environment
metadata:
  creationTimestamp: null
  name: go
spec:
  builder:
    command: build
    container:
      name: ""
      resources: {}
    image: ghcr.io/fission/go-builder
  imagepullsecret: ""
  keeparchive: false
  poolsize: 3
  resources: {}
  runtime:
    container:
      name: ""
      resources: {}
    image: ghcr.io/fission/go-env
  version: 3

Which issue(s) this PR fixes:

Fixes #2786

Testing

  • Add sidecar containers to builder and runtime pods.
  • Using invalid builder and runtime container names either in containerSpec or podSpec or both places will not create builder and runtime deployments.

Checklist:

  • I ran tests as well as code linting locally to verify my changes.
  • I have done manual verification of my changes, changes working as expected.
  • I have added new tests to cover my changes.
  • My changes follow contributing guidelines of Fission.
  • I have signed all of my commits.

Copy link

codecov bot commented Oct 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 45.97%. Comparing base (fe7f1b0) to head (ad0f158).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3033      +/-   ##
==========================================
+ Coverage   45.85%   45.97%   +0.11%     
==========================================
  Files         236      236              
  Lines       19566    19580      +14     
==========================================
+ Hits         8972     9001      +29     
+ Misses       9190     9177      -13     
+ Partials     1404     1402       -2     
Flag Coverage Δ
unittests 45.97% <100.00%> (+0.11%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

…instead of keeping it empty.

Add skeleton for podSpec field to give user an idea of how to use podSpec field.

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
…er tests

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
Add the negative test.

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
@sanketsudake sanketsudake merged commit 36f3181 into main Oct 9, 2024
10 checks passed
@sanketsudake sanketsudake deleted the env-pod-spec branch January 1, 2025 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

how to set nodeSelector to Environment POD
2 participants