File tree Expand file tree Collapse file tree
scripts/azure-vn/deployment Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3939
4040# Input files
4141INPUT_FILES=(
42- operator.json operator.parameters.json
43- vault.json vault.parameters.json
44- vnet.json vnet.parameters.json
45- gateway.json gateway.parameters.json
42+ operator.yaml
4643)
4744
4845# Copy input files to output dir
@@ -70,16 +67,17 @@ if [[ $? -ne 0 ]]; then
7067fi
7168
7269# Generate operator template
73- sed -i " s#IMAGE_PLACEHOLDER#${IMAGE} #g" ${OUTPUT_DIR} /operator.json && \
74- sed -i " s#IMAGE_VERSION_PLACEHOLDER#${IMAGE_VERSION} #g" ${OUTPUT_DIR} /operator.json
70+ sed -i " s#IMAGE_PLACEHOLDER#${IMAGE} #g" ${OUTPUT_DIR} /operator.yaml
71+ # && \
72+ # sed -i "s#IMAGE_VERSION_PLACEHOLDER#${IMAGE_VERSION}#g" ${OUTPUT_DIR}/operator.yaml
7573if [[ $? -ne 0 ]]; then
7674 echo " Failed to pre-process operator template file"
7775 exit 1
7876fi
7977
8078# Export the policy, update it to turn off allow_environment_variable_dropping, and then insert it into the template
8179# note that the EnclaveId is generated by generate.py on the raw policy, not the base64 version
82- POLICY_DIGEST_FILE=azure-cc -operator-digest-$VERSION_NUMBER .txt
80+ POLICY_DIGEST_FILE=azure-vn -operator-digest-$VERSION_NUMBER .txt
8381az confcom acipolicygen --approve-wildcards --template-file ${OUTPUT_DIR} /operator.json --print-policy > ${INPUT_DIR} /policy.base64
8482base64 -di < ${INPUT_DIR} /policy.base64 > ${INPUT_DIR} /generated.rego
8583sed -i " s#allow_environment_variable_dropping := true#allow_environment_variable_dropping := false#g" ${INPUT_DIR} /generated.rego
Original file line number Diff line number Diff line change 1+ import sys
2+ from hashlib import sha256
3+
4+ def str_to_sha256 (x : str ) -> str :
5+ return sha256 (x .encode ('utf-8' )).hexdigest ()
6+
7+ def print_data_sha256 (data : str ) -> str :
8+ print (str_to_sha256 (data ))
9+
10+ def print_data_sha256_stripped (data : str ) -> str :
11+ print (str_to_sha256 (data .strip ()))
12+
13+ def main ():
14+ with open (sys .argv [1 ], 'r' ) as file :
15+ data = file .read ()
16+
17+ print_data_sha256 (data )
18+
19+ if __name__ == '__main__' :
20+ main ()
Original file line number Diff line number Diff line change 1212 labels :
1313 app.kubernetes.io/name : operator
1414 annotations :
15- microsoft.containerinstance.virtualnode.ccepolicy : ' '
15+ microsoft.containerinstance.virtualnode.ccepolicy : CCE_POLICY_PLACEHOLDER
1616 microsoft.containerinstance.virtualnode.identity : IDENTITY_PLACEHOLDER
1717 microsoft.containerinstance.virtualnode.injectdns : " false"
1818 spec :
You can’t perform that action at this time.
0 commit comments