-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #434 from ulucinar/remove-tf-cli
Remove the Terraform CLI from the provider package and deprecate the relevant provider command-line flags
- Loading branch information
Showing
79 changed files
with
2,301 additions
and
2,886 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,15 @@ | ||
FROM alpine:3.19.0 AS builder | ||
RUN apk --no-cache add curl | ||
FROM alpine:3.19.0 | ||
RUN apk --no-cache add ca-certificates bash | ||
|
||
ARG TARGETOS | ||
ARG TARGETARCH | ||
|
||
# Setup Terraform environment | ||
|
||
## Provider-dependent configuration | ||
ARG TERRAFORM_VERSION | ||
ARG TERRAFORM_PROVIDER_VERSION | ||
ARG TERRAFORM_PROVIDER_DOWNLOAD_NAME | ||
## End of - Provider-dependent configuration | ||
|
||
RUN curl -L -o /tmp/terraform_${TERRAFORM_VERSION}_${TARGETOS}_${TARGETARCH}.zip https://github.com/upbound/terraform/releases/download/v${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_${TARGETOS}_${TARGETARCH}.zip \ | ||
&& unzip /tmp/terraform_${TERRAFORM_VERSION}_${TARGETOS}_${TARGETARCH}.zip -d /tmp/ \ | ||
&& chmod +x /tmp/terraform \ | ||
&& rm /tmp/terraform_${TERRAFORM_VERSION}_${TARGETOS}_${TARGETARCH}.zip \ | ||
&& curl -L -o /tmp/${TERRAFORM_PROVIDER_DOWNLOAD_NAME}_${TERRAFORM_PROVIDER_VERSION}_${TARGETOS}_${TARGETARCH}.zip https://releases.hashicorp.com/${TERRAFORM_PROVIDER_DOWNLOAD_NAME}/${TERRAFORM_PROVIDER_VERSION}/${TERRAFORM_PROVIDER_DOWNLOAD_NAME}_${TERRAFORM_PROVIDER_VERSION}_${TARGETOS}_${TARGETARCH}.zip \ | ||
&& unzip /tmp/${TERRAFORM_PROVIDER_DOWNLOAD_NAME}_${TERRAFORM_PROVIDER_VERSION}_${TARGETOS}_${TARGETARCH}.zip -d /tmp/native/ \ | ||
&& chmod +x /tmp/native/* \ | ||
&& rm /tmp/${TERRAFORM_PROVIDER_DOWNLOAD_NAME}_${TERRAFORM_PROVIDER_VERSION}_${TARGETOS}_${TARGETARCH}.zip | ||
# End of - Setup Terraform environment | ||
|
||
FROM alpine:3.19.0 as base | ||
|
||
ARG CROSSPLANE_PROVIDER_VERSION | ||
ARG TARGETOS | ||
ARG TARGETARCH | ||
ARG TERRAFORM_VERSION | ||
ARG TERRAFORM_PROVIDER_SOURCE | ||
ARG TERRAFORM_PROVIDER_VERSION | ||
ARG TERRAFORM_PROVIDER_DOWNLOAD_NAME | ||
ARG PLUGIN_DIR=/terraform/provider-mirror/registry.terraform.io/${TERRAFORM_PROVIDER_SOURCE}/${TERRAFORM_PROVIDER_VERSION}/${TARGETOS}_${TARGETARCH} | ||
|
||
ENV USER_ID=65532 | ||
ENV TF_CLI_CONFIG_FILE /terraform/.terraformrc | ||
ENV TF_FORK 0 | ||
# set user agent | ||
ENV GOOGLE_TERRAFORM_USERAGENT_EXTENSION "upbound-provider-gcp/${CROSSPLANE_PROVIDER_VERSION}" | ||
|
||
# Provider controller needs these environment variable at runtime | ||
ENV TERRAFORM_VERSION ${TERRAFORM_VERSION} | ||
ENV TERRAFORM_PROVIDER_SOURCE ${TERRAFORM_PROVIDER_SOURCE} | ||
ENV TERRAFORM_PROVIDER_VERSION ${TERRAFORM_PROVIDER_VERSION} | ||
ENV TERRAFORM_NATIVE_PROVIDER_PATH ${PLUGIN_DIR}/${TERRAFORM_PROVIDER_DOWNLOAD_NAME}_v${TERRAFORM_PROVIDER_VERSION}_x5 | ||
|
||
RUN apk --no-cache add ca-certificates bash | ||
|
||
USER ${USER_ID} | ||
EXPOSE 8080 | ||
|
||
ADD terraformrc.hcl ${TF_CLI_CONFIG_FILE} | ||
COPY --from=builder /tmp/terraform /usr/local/bin/ | ||
COPY --from=builder /tmp/native/* ${PLUGIN_DIR}/ | ||
|
||
ENTRYPOINT ["provider"] | ||
ENTRYPOINT ["provider"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.