Skip to content

Get domain and API URL from cluster instead of variables#71

Open
juliaaano wants to merge 1 commit intomainfrom
jm-31122
Open

Get domain and API URL from cluster instead of variables#71
juliaaano wants to merge 1 commit intomainfrom
jm-31122

Conversation

@juliaaano
Copy link
Contributor

No description provided.

Copy link
Contributor

@newgoliath newgoliath left a comment

Choose a reason for hiding this comment

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

fantastic!

Copy link
Contributor

@wkulhanek wkulhanek left a comment

Choose a reason for hiding this comment

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

No. The variables come from the caller. We don't query the cluster in every single workload

@wkulhanek
Copy link
Contributor

We have standard variables that are available whenever either open shift-cluster or openshift-workloads calls a workload:

https://github.com/agnosticd/agnosticd-v2/blob/main/ansible/roles/host_ocp4_installer_info/tasks/main.yml#L54-L59

@juliaaano
Copy link
Contributor Author

No. The variables come from the caller. We don't query the cluster in every single workload

That's not true. The variables are expected to be available as global variables. And there are no safety checks! If they came from the caller, then we would have that being passed/set in agV common.yaml.

I thought you appreciated not depending on the global vars and being explicit, so I don't understand the pushback, it can't be the cost of querying the cluster?

I'll give you a use case. I need to run this role standalone (separate) when doing local dev execution. In that case, it fails unless I set those vars myself.

@juliaaano juliaaano requested a review from wkulhanek February 24, 2026 15:58
@wkulhanek
Copy link
Contributor

@juliaaano how are you running the role? If you run via the open shift-workloads config you don't have that problem. If not you'll have to pass the vars for your specific cluster. You want every single role to call the cluster for the information that it needs? When the information is readily available?

@juliaaano
Copy link
Contributor Author

@wkulhanek

That’s a bit unfortunate, but not a big deal. I wasn’t expecting you to argue that we should rely on global variables, even if they seem to be common sense.

I’ve never developed in agnosticd with the notion of standard variables, and I’ve never seen that documented anywhere. In my view, most people were using those vars because it was easy, not necessarily because it was the right thing to do.

@wkulhanek
Copy link
Contributor

Understood. But that's the pattern that every single role in core_workloads follows and (since @newgoliath asked) that's documented in the example role. I made sure that we didn't query the same thing in every role - it was a mess - different vars, different way to query (oc whomi command anyone), etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants