test/plugin/constants.rb in fluent-plugin-google-cloud-0.6.18 vs test/plugin/constants.rb in fluent-plugin-google-cloud-0.6.19

- old
+ new

@@ -41,10 +41,13 @@ CUSTOM_PROJECT_ID = 'test-custom-project-id'.freeze CUSTOM_ZONE = 'us-custom-central1-b'.freeze CUSTOM_FULLY_QUALIFIED_ZONE = "projects/#{PROJECT_ID}/zones/#{ZONE}".freeze CUSTOM_VM_ID = 'C9876543210'.freeze CUSTOM_HOSTNAME = 'custom.hostname.org'.freeze + # Kubernetes-specific attributes. + CUSTOM_K8S_CLUSTER_NAME = 'kubernetes-cluster'.freeze + CUSTOM_K8S_LOCATION = 'kubernetes-location'.freeze # Attributes used for the EC2 metadata service. EC2_PROJECT_ID = 'test-ec2-project-id'.freeze EC2_ZONE = 'us-west-2b'.freeze EC2_PREFIXED_ZONE = "aws:#{EC2_ZONE}".freeze @@ -255,10 +258,16 @@ zone #{CUSTOM_ZONE} ).freeze CONFIG_MISSING_METADATA_ALL = %( ).freeze + CUSTOM_K8S_ENABLE_METADATA_AGENT_CONFIG = %( + enable_metadata_agent true + k8s_cluster_name #{CUSTOM_K8S_CLUSTER_NAME} + k8s_cluster_location #{CUSTOM_K8S_LOCATION} + ).freeze + CONFIG_EC2_PROJECT_ID = %( project_id #{EC2_PROJECT_ID} ).freeze CONFIG_EC2_PROJECT_ID_AND_CUSTOM_VM_ID = %( @@ -439,10 +448,18 @@ labels: K8S_CONTAINER_PARAMS[:resource][:labels].merge( 'location' => K8S_LOCATION2 ) ) ).freeze + K8S_CONTAINER_PARAMS_CUSTOM = K8S_CONTAINER_PARAMS.merge( + resource: K8S_CONTAINER_PARAMS[:resource].merge( + labels: K8S_CONTAINER_PARAMS[:resource][:labels].merge( + 'cluster_name' => CUSTOM_K8S_CLUSTER_NAME, + 'location' => CUSTOM_K8S_LOCATION + ) + ) + ).freeze # K8s Node. K8S_NODE_PARAMS = { resource: { type: K8S_NODE_CONSTANTS[:resource_type], @@ -458,9 +475,17 @@ }.freeze K8S_NODE_PARAMS_FROM_LOCAL = K8S_NODE_PARAMS.merge( resource: K8S_NODE_PARAMS[:resource].merge( labels: K8S_NODE_PARAMS[:resource][:labels].merge( 'location' => K8S_LOCATION2 + ) + ) + ).freeze + K8S_NODE_PARAMS_CUSTOM = K8S_NODE_PARAMS.merge( + resource: K8S_NODE_PARAMS[:resource].merge( + labels: K8S_NODE_PARAMS[:resource][:labels].merge( + 'cluster_name' => CUSTOM_K8S_CLUSTER_NAME, + 'location' => CUSTOM_K8S_LOCATION ) ) ).freeze # Docker Container.