Skip to content

Add env vars to the whisker deployment#3805

Merged
Brian-McM merged 2 commits intotigera:masterfrom
WilliamTigera:whisker-deployment-env-vars
Mar 28, 2025
Merged

Add env vars to the whisker deployment#3805
Brian-McM merged 2 commits intotigera:masterfrom
WilliamTigera:whisker-deployment-env-vars

Conversation

@WilliamTigera
Copy link
Contributor

@WilliamTigera WilliamTigera commented Mar 6, 2025

Description

Add ENV vars that the whisker UI to retrieve cluster context.

Copied over ClusterInformation CR so we don't need to use the V3 api (and wait for apiserver)

For PR author

  • Tests for change.
  • If changing pkg/apis/, run make gen-files
  • If changing versions, run make gen-versions

For PR reviewers

A note for code reviewers - all pull requests must have the following:

  • Milestone set according to targeted release.
  • Appropriate labels:
    • kind/bug if this is a bugfix.
    • kind/enhancement if this is a a new feature.
    • enterprise if this PR applies to Calico Enterprise only.

@WilliamTigera WilliamTigera requested a review from a team as a code owner March 6, 2025 23:56
@marvin-tigera marvin-tigera added this to the v1.38.0 milestone Mar 6, 2025
@WilliamTigera WilliamTigera force-pushed the whisker-deployment-env-vars branch 2 times, most recently from c0e660d to eb419a3 Compare March 17, 2025 22:32
@danudey danudey modified the milestones: v1.38.0, v1.39.0 Mar 21, 2025
@WilliamTigera WilliamTigera force-pushed the whisker-deployment-env-vars branch 3 times, most recently from f20da3f to 8d47f01 Compare March 26, 2025 04:23
}()

// API server needs to be installed to use the v3 api
createAPIServer(c, mgr, shutdownContext, nil)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is supposed to run in an OS cluster, so we can't rely on the api server being installed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed htis by copying over the clusterinformation cr reference to the repo.

Brian-McM
Brian-McM previously approved these changes Mar 27, 2025
@Brian-McM Brian-McM dismissed their stale review March 27, 2025 18:46

found an issue.

if err != nil {
reqLogger.Info("Unable to retrieve cluster context to Whisker. Proceeding without adding cluster context to Whisker.", err)
}
calicoVersion = clusterInfo.Spec.CalicoVersion
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will panic if the clusterInfo isn't there, Spec will be nil. I would not set the cluster type or calico versions if this is nil.

The whisker backend should handle that appropriate if the env variables are not set.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note these values are fed to the whisker front end directly.

@WilliamTigera WilliamTigera force-pushed the whisker-deployment-env-vars branch from fdf5b4c to 9a93fd3 Compare March 27, 2025 21:56
Update controller.go

Update mainline_test.go

Update whisker_test.go

change scheme

Update mainline_test.go

Update mainline_test.go

minor cleanup

Update controller.go

Use crdv1 instead of v3 code to get cluster information

Update controller.go

Change to using cluster ID

Empty commit

Empty commit
@WilliamTigera WilliamTigera force-pushed the whisker-deployment-env-vars branch from 31d910f to b2a5053 Compare March 28, 2025 16:24
@Brian-McM Brian-McM merged commit 3311fe5 into tigera:master Mar 28, 2025
5 checks passed
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.

5 participants