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

Expose user-facing constants #3149

Closed
nojnhuh opened this issue Jul 19, 2023 · 1 comment · Fixed by #3171
Closed

Expose user-facing constants #3149

nojnhuh opened this issue Jul 19, 2023 · 1 comment · Fixed by #3171
Assignees
Labels
high-priority Issues we intend to prioritize (security, outage, blocking bug)
Milestone

Comments

@nojnhuh
Copy link
Member

nojnhuh commented Jul 19, 2023

Describe the current behavior
Currently, some constant variables that would be useful to import to other Go projects can't be because they are defined in internal packages.

e.g.

// ReconcilePolicyAnnotation describes the reconcile policy for the resource in question.
// A reconcile policy describes what action (if any) the operator is allowed to take when
// reconciling the resource.
// If no reconcile policy is specified, the default is "run"
const ReconcilePolicyAnnotation = "serviceoperator.azure.com/reconcile-policy"
type ReconcilePolicy string
const (
// ReconcilePolicyManage instructs the operator to manage the resource in question.
// This includes issuing PUTs to update it and DELETE's to delete it from Azure if deleted in Kuberentes.
// This is the default policy when no policy is specified.
ReconcilePolicyManage = ReconcilePolicy("manage")
// ReconcilePolicySkip instructs the operator to skip all reconciliation actions. This includes creating
// the resource.
ReconcilePolicySkip = ReconcilePolicy("skip")
// ReconcilePolicyDetachOnDelete instructs the operator to skip deletion of resources in Azure. This allows
// deletion of the resource in Kubernetes to go through but does not delete the underlying Azure resource.
ReconcilePolicyDetachOnDelete = ReconcilePolicy("detach-on-delete")
)

const PerResourceSecretAnnotation = "serviceoperator.azure.com/credential-from"

const (
// #nosec
ClientSecretVar = "AZURE_CLIENT_SECRET"
SubscriptionIDVar = "AZURE_SUBSCRIPTION_ID"
TenantIDVar = "AZURE_TENANT_ID"
ClientIDVar = "AZURE_CLIENT_ID"
ClientCertificateVar = "AZURE_CLIENT_CERTIFICATE"
// #nosec
ClientCertificatePasswordVar = "AZURE_CLIENT_CERTIFICATE_PASSWORD"
targetNamespacesVar = "AZURE_TARGET_NAMESPACES"
operatorModeVar = "AZURE_OPERATOR_MODE"
syncPeriodVar = "AZURE_SYNC_PERIOD"
resourceManagerEndpointVar = "AZURE_RESOURCE_MANAGER_ENDPOINT"
resourceManagerAudienceVar = "AZURE_RESOURCE_MANAGER_AUDIENCE"
azureAuthorityHostVar = "AZURE_AUTHORITY_HOST"
podNamespaceVar = "POD_NAMESPACE"
useWorkloadIdentityAuth = "USE_WORKLOAD_IDENTITY_AUTH"
// #nosec
FederatedTokenFilePath = "/var/run/secrets/tokens/azure-identity"
)

Describe the improvement
It would be helpful to projects like CAPZ if these definitions were either moved or mirrored to packages that external projects can import.

Additional context
Add any other context about the suggested improvement.

@matthchr
Copy link
Member

Can put this into genruntime or maybe even better a common

@matthchr matthchr added the high-priority Issues we intend to prioritize (security, outage, blocking bug) label Jul 24, 2023
@super-harsh super-harsh self-assigned this Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
high-priority Issues we intend to prioritize (security, outage, blocking bug)
Projects
Development

Successfully merging a pull request may close this issue.

3 participants